diff --git a/src/components/Checkbox/CheckboxItem.tsx b/src/components/Checkbox/CheckboxItem.tsx index f57bd875c3..4ad4910d02 100644 --- a/src/components/Checkbox/CheckboxItem.tsx +++ b/src/components/Checkbox/CheckboxItem.tsx @@ -111,8 +111,20 @@ const CheckboxItem = ({ } return ( - - + + {isLeading && checkbox} { @@ -47,3 +48,30 @@ it('can render leading checkbox control', () => { .toJSON(); expect(tree).toMatchSnapshot(); }); + +it('should have `accessibilityState={ checked: true }` when `status="checked"`', () => { + const { getByA11yState } = render( + + ); + + const element = getByA11yState({ checked: true }); + expect(element).toBeTruthy(); +}); + +it('should have `accessibilityState={ checked: false }` when `status="unchecked"', () => { + const { getByA11yState } = render( + + ); + + const element = getByA11yState({ checked: false }); + expect(element).toBeTruthy(); +}); + +it('should have `accessibilityState={ checked: false }` when `status="indeterminate"', () => { + const { getByA11yState } = render( + + ); + + const element = getByA11yState({ checked: false }); + expect(element).toBeTruthy(); +}); diff --git a/src/components/__tests__/Checkbox/__snapshots__/CheckboxItem.test.js.snap b/src/components/__tests__/Checkbox/__snapshots__/CheckboxItem.test.js.snap index 47afd7b9e8..dd78a59b72 100644 --- a/src/components/__tests__/Checkbox/__snapshots__/CheckboxItem.test.js.snap +++ b/src/components/__tests__/Checkbox/__snapshots__/CheckboxItem.test.js.snap @@ -2,6 +2,13 @@ exports[`can render leading checkbox control 1`] = `