Skip to content

Commit

Permalink
chore: shorten syntax for isElementCollapsed check
Browse files Browse the repository at this point in the history
  • Loading branch information
siepra authored and mdjastrzebski committed Sep 19, 2023
1 parent 450fd5b commit fcfed40
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/helpers/accessiblity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,5 @@ export function isElementCollapsed(
element: ReactTestInstance
): NonNullable<AccessibilityState['expanded']> {
const { accessibilityState, 'aria-expanded': ariaExpanded } = element.props;
return ariaExpanded !== undefined
? !ariaExpanded
: accessibilityState !== undefined
? !accessibilityState.expanded
: false;
return (ariaExpanded ?? accessibilityState?.expanded) === false;
}

0 comments on commit fcfed40

Please sign in to comment.