diff --git a/src/components/switch/__tests__/index.spec.tsx b/src/components/switch/__tests__/index.spec.tsx index 095bb84f5a..fd1b4d892e 100644 --- a/src/components/switch/__tests__/index.spec.tsx +++ b/src/components/switch/__tests__/index.spec.tsx @@ -47,12 +47,6 @@ describe('Switch', () => { expect(onValueChange).not.toHaveBeenCalled(); }); - it('Accessibility value should be true when checked', async () => { - const driver = testCase(testID, {value: true}); - - expect(driver.getAccessibilityValue()).toBe(true); - }); - it('Accessibility value should be false when not checked', async () => { const driver = testCase(testID, {value: false}); @@ -65,12 +59,6 @@ describe('Switch', () => { expect(driver.isChecked()).toBe(true); }); - it('Accessibility value should be false when not checked', async () => { - const driver = testCase(testID, {value: false}); - - expect(driver.getAccessibilityValue()).toBe(false); - }); - it('Should be disabled', async () => { const driver = testCase(testID, {disabled: true}); diff --git a/src/components/switch/index.tsx b/src/components/switch/index.tsx index ac3e498b12..367bb96aa2 100644 --- a/src/components/switch/index.tsx +++ b/src/components/switch/index.tsx @@ -83,15 +83,10 @@ class Switch extends Component { getAccessibilityProps() { const {disabled, value} = this.props; - return { accessible: true, accessibilityRole: 'switch', - accessibilityState: { - disabled, - checked: value ? 'checked' : 'unchecked' - }, - accessibilityValue: {text: value ? '1' : '0'} + accessibilityState: {disabled, checked: value} }; } diff --git a/src/components/switch/switch.driver.ts b/src/components/switch/switch.driver.ts index 836b81a805..1d46c3fa95 100644 --- a/src/components/switch/switch.driver.ts +++ b/src/components/switch/switch.driver.ts @@ -6,9 +6,8 @@ export const SwitchDriver = (props: ComponentProps) => { const driver = usePressableDriver(useComponentDriver(props)); const getStyle = () => driver.getElement().props.style as ViewStyle; - const getAccessibilityValue = () => driver.getElement().props.accessibilityValue?.text === '1'; const isDisabled = () => driver.getElement().props.accessibilityState?.disabled === true; - const isChecked = () => driver.getElement().props.accessibilityValue?.text === '1'; + const isChecked = () => driver.getElement().props.accessibilityState?.checked; - return {...driver, getStyle, getAccessibilityValue, isDisabled, isChecked}; + return {...driver, getStyle, isDisabled, isChecked}; };