MCPcopy
hub / github.com/callstack/react-native-testing-library / computeAriaDisabled

Function computeAriaDisabled

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

Source from the content-addressed store, hash-verified

224
225// See: https://github.com/callstack/react-native-testing-library/wiki/Accessibility:-State#disabled-state
226export function computeAriaDisabled(instance: TestInstance): boolean {
227 if (isHostTextInput(instance) && !isEditableTextInput(instance)) {
228 return true;
229 }
230
231 const { props } = instance;
232
233 if (isHostText(instance) && props.disabled) {
234 return true;
235 }
236
237 return props['aria-disabled'] ?? props.accessibilityState?.disabled ?? false;
238}
239
240// See: https://github.com/callstack/react-native-testing-library/wiki/Accessibility:-State#expanded-state
241export function computeAriaExpanded({ props }: TestInstance): boolean | undefined {

Callers 5

matchAccessibilityStateFunction · 0.90
toBeDisabledFunction · 0.90
toBeEnabledFunction · 0.90
isAncestorDisabledFunction · 0.90

Calls 3

isHostTextInputFunction · 0.90
isEditableTextInputFunction · 0.90
isHostTextFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…