(instance: TestInstance)
| 55 | }; |
| 56 | |
| 57 | const queryAllByRole = (instance: TestInstance): QueryAllByQuery<ByRoleMatcher, ByRoleOptions> => |
| 58 | function queryAllByRoleFn(role, options) { |
| 59 | const normalizedRole = typeof role === 'string' ? normalizeRole(role) : role; |
| 60 | return findAll( |
| 61 | instance, |
| 62 | (item) => |
| 63 | // run the cheapest checks first, and early exit to avoid unneeded computations |
| 64 | isAccessibilityElement(item) && |
| 65 | matchStringProp(getRole(item), normalizedRole) && |
| 66 | matchAccessibleStateIfNeeded(item, options) && |
| 67 | matchAccessibilityValueIfNeeded(item, options?.value) && |
| 68 | matchAccessibleNameIfNeeded(item, options?.name), |
| 69 | options, |
| 70 | ); |
| 71 | }; |
| 72 | |
| 73 | const formatQueryParams = (role: TextMatch, options: ByRoleOptions = {}) => { |
| 74 | const params = [`role: ${String(role)}`]; |
nothing calls this directly
no test coverage detected
searching dependent graphs…