From 94f7701155e06482773c481225382abe084738ee Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Tue, 5 May 2026 08:36:20 +0700 Subject: [PATCH] fix(app): set aria-checked directly on Switch so toBeChecked() assertions work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- packages/app/src/components/ui/switch.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/app/src/components/ui/switch.tsx b/packages/app/src/components/ui/switch.tsx index 66e0738d24..0e25049fe5 100644 --- a/packages/app/src/components/ui/switch.tsx +++ b/packages/app/src/components/ui/switch.tsx @@ -99,6 +99,7 @@ export function Switch({ hitSlop={8} accessibilityRole="switch" accessibilityState={accessibilityState} + aria-checked={value} accessibilityLabel={accessibilityLabel} testID={testID} style={pressableStyle}