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

Function matchAccessibleNameIfNeeded

src/queries/role.ts:39–44  ·  view source on GitHub ↗
(instance: TestInstance, name?: TextMatch)

Source from the content-addressed store, hash-verified

37 };
38
39const matchAccessibleNameIfNeeded = (instance: TestInstance, name?: TextMatch) => {
40 if (name == null) return true;
41
42 const accessibleName = computeAccessibleName(instance);
43 return matches(name, accessibleName);
44};
45
46const matchAccessibleStateIfNeeded = (instance: TestInstance, options?: ByRoleOptions) => {
47 return options != null ? matchAccessibilityState(instance, options) : true;

Callers 1

queryAllByRoleFunction · 0.85

Calls 2

computeAccessibleNameFunction · 0.90
matchesFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…