MCPcopy Index your code
hub / github.com/callstack/react-native-testing-library / computeAriaChecked

Function computeAriaChecked

src/helpers/accessibility.ts:210–223  ·  view source on GitHub ↗
(instance: TestInstance)

Source from the content-addressed store, hash-verified

208
209// See: https://github.com/callstack/react-native-testing-library/wiki/Accessibility:-State#checked-state
210export function computeAriaChecked(instance: TestInstance): AccessibilityState['checked'] {
211 const { props } = instance;
212
213 if (isHostSwitch(instance)) {
214 return props.value;
215 }
216
217 const role = getRole(instance);
218 if (!rolesSupportingCheckedState[role]) {
219 return undefined;
220 }
221
222 return props['aria-checked'] ?? props.accessibilityState?.checked;
223}
224
225// See: https://github.com/callstack/react-native-testing-library/wiki/Accessibility:-State#disabled-state
226export function computeAriaDisabled(instance: TestInstance): boolean {

Callers 4

matchAccessibilityStateFunction · 0.90
toBePartiallyCheckedFunction · 0.90
toBeCheckedFunction · 0.90

Calls 2

isHostSwitchFunction · 0.90
getRoleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…