Skip to content

Commit fcfed40

Browse files
siepramdjastrzebski
authored andcommitted
chore: shorten syntax for isElementCollapsed check
1 parent 450fd5b commit fcfed40

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/helpers/accessiblity.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,5 @@ export function isElementCollapsed(
231231
element: ReactTestInstance
232232
): NonNullable<AccessibilityState['expanded']> {
233233
const { accessibilityState, 'aria-expanded': ariaExpanded } = element.props;
234-
return ariaExpanded !== undefined
235-
? !ariaExpanded
236-
: accessibilityState !== undefined
237-
? !accessibilityState.expanded
238-
: false;
234+
return (ariaExpanded ?? accessibilityState?.expanded) === false;
239235
}

0 commit comments

Comments
 (0)