fix(app): set aria-checked directly on Switch so toBeChecked() assertions work

RNW's createDOMProps maps direct aria-* props to the DOM but does not
read from accessibilityState.checked. The Switch was relying on the
latter, so no aria-checked attribute was ever rendered — making the
component opaque to screen readers and breaking Playwright's
toBeChecked() assertions in E2E tests. Passing aria-checked={value}
alongside the existing accessibilityState fixes both.
This commit is contained in:
Mohamed Boudra
2026-05-05 08:36:20 +07:00
parent ba68e2599b
commit 94f7701155
@@ -99,6 +99,7 @@ export function Switch({
hitSlop={8}
accessibilityRole="switch"
accessibilityState={accessibilityState}
aria-checked={value}
accessibilityLabel={accessibilityLabel}
testID={testID}
style={pressableStyle}