Skip to content

Commit 829043c

Browse files
committed
refactor: self code review
1 parent 5920604 commit 829043c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/queries/role.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ export type ByRoleOptions = CommonQueryOptions &
3939
value?: AccessibilityValueMatcher;
4040
};
4141

42-
const matchRole = (node: ReactTestInstance, role: ByRoleMatcher) => {
43-
return matchStringProp(getRole(node), role);
44-
};
45-
4642
const matchAccessibleNameIfNeeded = (node: ReactTestInstance, name?: TextMatch) => {
4743
if (name == null) return true;
4844

@@ -71,7 +67,7 @@ const queryAllByRole = (
7167
(node) =>
7268
// run the cheapest checks first, and early exit to avoid unneeded computations
7369
isAccessibilityElement(node) &&
74-
matchRole(node, normalizedRole) &&
70+
matchStringProp(getRole(node), normalizedRole) &&
7571
matchAccessibleStateIfNeeded(node, options) &&
7672
matchAccessibilityValueIfNeeded(node, options?.value) &&
7773
matchAccessibleNameIfNeeded(node, options?.name),

0 commit comments

Comments
 (0)