react-native-testing-library icon indicating copy to clipboard operation
react-native-testing-library copied to clipboard

Supports accessibilityStates in ByRole queries

Open AugustinLF opened this issue 3 years ago • 0 comments

Describe the Feature

Like in @testing-library/dom (see docs), we should support accessibility states when querying by role.

The accessibilityStates existing are

  • disabled: Indicates whether the element is disabled or not
  • selected: Indicates whether a selectable element is currently selected or not
  • checked: Indicates the state of a checkable element.
  • busy: Indicates whether an element is currently busy or not
  • expanded: Indicates whether an expandable element is currently expanded or collapsed

Possible Implementations

We could like in DTL check which states correspond to which role and throw. But I'd treat that as a bonus and not a necessity.

Related Issues

#1133

AugustinLF avatar Sep 23 '22 09:09 AugustinLF