File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
packages/bezier-react/src/components/Forms/RadioGroup Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,17 @@ describe('RadioGroup', () => {
5353 const { getByRole } = renderRadioGroup ( { radioGroupProps : { required : true } } )
5454 expect ( getByRole ( 'radiogroup' ) ) . toBeRequired ( )
5555 } )
56+
57+ it ( 'should be disabled when disabled prop is true' , ( ) => {
58+ const { getByRole } = renderRadioGroup ( { radioGroupProps : { disabled : true } } )
59+ expect ( getByRole ( 'radiogroup' ) ) . toHaveAttribute ( 'aria-disabled' , 'true' )
60+ } )
61+
62+ it ( 'children(Radio) should be disabled when disabled prop is true' , ( ) => {
63+ const { getAllByRole } = renderRadioGroup ( { radioGroupProps : { disabled : true } } )
64+ const radios = getAllByRole ( 'radio' )
65+ radios . forEach ( radio => expect ( radio ) . toBeDisabled ( ) )
66+ } )
5667 } )
5768
5869 describe ( 'User Interactions' , ( ) => {
@@ -151,12 +162,6 @@ describe('RadioGroup', () => {
151162 const radios = getAllByRole ( 'radio' )
152163 radios . forEach ( radio => expect ( radio ) . toBeDisabled ( ) )
153164 } )
154-
155- it ( 'should be disabled when disabled prop of RadioGroup is true' , ( ) => {
156- const { getAllByRole } = renderRadioGroup ( { radioGroupProps : { disabled : false } , radioProps : { disabled : true } } )
157- const radios = getAllByRole ( 'radio' )
158- radios . forEach ( radio => expect ( radio ) . toBeDisabled ( ) )
159- } )
160165 } )
161166 } )
162167} )
You can’t perform that action at this time.
0 commit comments