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

Function normalizeRole

src/helpers/accessibility.ts:140–146  ·  view source on GitHub ↗
(role: string)

Source from the content-addressed store, hash-verified

138 * @returns Normalized role
139 */
140export function normalizeRole(role: string): Role | AccessibilityRole {
141 if (role === 'image') {
142 return 'img';
143 }
144
145 return role as Role | AccessibilityRole;
146}
147
148export function computeAriaModal(instance: TestInstance): boolean | undefined {
149 return instance.props['aria-modal'] ?? instance.props.accessibilityViewIsModal;

Callers 3

queryAllByRoleFunction · 0.90
getRoleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…