@@ -44,39 +44,36 @@ it('can render leading checkbox control', () => {
4444 expect ( tree ) . toMatchSnapshot ( ) ;
4545} ) ;
4646
47- it ( 'should have `accessibilityState={ checked: true } ` when `status="checked"`' , ( ) => {
48- const { getAllByA11yState } = render (
47+ it ( 'should have `aria- checked=" true" ` when `status="checked"`' , ( ) => {
48+ const { getByRole } = render (
4949 < Checkbox . Item status = "checked" label = "Checked Button" />
5050 ) ;
5151
52- const elements = getAllByA11yState ( { checked : true } ) ;
53- expect ( elements ) . toHaveLength ( 2 ) ;
52+ expect ( getByRole ( 'checkbox' ) ) . toBeChecked ( ) ;
5453} ) ;
5554
56- it ( 'should have `accessibilityState={ checked: false } ` when `status="unchecked"' , ( ) => {
57- const { getAllByA11yState } = render (
55+ it ( 'should have `aria- checked=" false" ` when `status="unchecked"` ' , ( ) => {
56+ const { getByRole } = render (
5857 < Checkbox . Item status = "unchecked" label = "Unchecked Button" />
5958 ) ;
6059
61- const elements = getAllByA11yState ( { checked : false } ) ;
62- expect ( elements ) . toHaveLength ( 2 ) ;
60+ expect ( getByRole ( 'checkbox' ) ) . not . toBeChecked ( ) ;
6361} ) ;
6462
65- it ( 'should have `accessibilityState={ checked: false } ` when `status="indeterminate"' , ( ) => {
66- const { getAllByA11yState } = render (
63+ it ( 'should have `aria- checked=" false" ` when `status="indeterminate"` ' , ( ) => {
64+ const { getByRole } = render (
6765 < Checkbox . Item status = "indeterminate" label = "Indeterminate Button" />
6866 ) ;
6967
70- const elements = getAllByA11yState ( { checked : false } ) ;
71- expect ( elements ) . toHaveLength ( 2 ) ;
68+ expect ( getByRole ( 'checkbox' ) ) . not . toBeChecked ( ) ;
7269} ) ;
7370
7471it ( 'disables the row when the prop disabled is true' , ( ) => {
7572 const { getByLabelText } = render (
7673 < Checkbox . Item
7774 status = "unchecked"
7875 label = ""
79- aria-label = "some checkbox"
76+ accessibilityLabel = "some checkbox"
8077 disabled
8178 />
8279 ) ;
@@ -92,8 +89,10 @@ it('should have maxFontSizeMultiplier set to 1.5 by default', () => {
9289 const { getByTestId } = render (
9390 < Checkbox . Item label = "" testID = "checkbox-item" status = "unchecked" />
9491 ) ;
95- const checkboxItemText = getByTestId ( 'checkbox-item-text' ) ;
96- expect ( checkboxItemText . props . maxFontSizeMultiplier ) . toBe ( 1.5 ) ;
92+
93+ expect (
94+ getByTestId ( 'checkbox-item-text' , { includeHiddenElements : true } )
95+ ) . toHaveProp ( 'maxFontSizeMultiplier' , 1.5 ) ;
9796} ) ;
9897
9998it ( 'should execute onLongPress' , ( ) => {
0 commit comments