-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix traffic splitting required fields
- Loading branch information
Showing
5 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...src/components/formik-fields/multi-column-field/__tests__/MultiColumnFieldHeader.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import * as React from 'react'; | ||
import { shallow, ShallowWrapper } from 'enzyme'; | ||
import { gridItemSpanValueShape } from '@patternfly/react-core'; | ||
import MultiColumnFieldHeader, { MultiColumnFieldHeaderProps } from '../MultiColumnFieldHeader'; | ||
|
||
describe('MultiColumnFieldHeader', () => { | ||
let headerProps: MultiColumnFieldHeaderProps; | ||
let wrapper: ShallowWrapper<MultiColumnFieldHeaderProps>; | ||
|
||
beforeEach(() => { | ||
headerProps = { | ||
headers: [ | ||
{ | ||
name: 'Test Field', | ||
required: true, | ||
}, | ||
], | ||
spans: [12 as gridItemSpanValueShape], | ||
}; | ||
wrapper = shallow(<MultiColumnFieldHeader {...headerProps} />); | ||
}); | ||
|
||
it('should render required label when prop is of type Object[] with property required set to true', () => { | ||
expect(wrapper.contains('*')).toBe(true); | ||
}); | ||
|
||
it('should not render required label when prop is of type string[]', () => { | ||
headerProps.headers = ['Testing Field']; | ||
wrapper = shallow(<MultiColumnFieldHeader {...headerProps} />); | ||
expect(wrapper.contains('*')).toBe(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters