You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
toHaveAccessibleName is a Jest DOM matcher asserting that given element has certain accessible name: text content or a11y label.
RNTL already contains some code working with accessible name, namely *ByRole query accepts an optional name param. This matcher should compare expect name parameter with all of these:
text content of element referenced by accessibilityLabelledBy / aria-labelledby prop
accessbilityLabel / aria-label prop
text content of given element
These should be evaluated in that particular order.
mdjastrzebski
changed the title
feature: implement toHaveAccessibilityValue Jest matcher
feature: implement toHaveAccessibleValue Jest matcher
Sep 19, 2023
Describe the Feature
toHaveAccessibleName
is a Jest DOM matcher asserting that given element has certain accessible name: text content or a11y label.RNTL already contains some code working with accessible name, namely
*ByRole
query accepts an optionalname
param. This matcher should compare expect name parameter with all of these:accessibilityLabelledBy
/aria-labelledby
propaccessbilityLabel
/aria-label
propThese should be evaluated in that particular order.
Possible Implementations
Proposed API:
The matcher should:
expectedName
param is provided check if it matches element's accessible nameexpectedName
is not provided check if element has accessible nameEach matcher should have a fairly comprehensive test suite.
Related Issues
#1454
The text was updated successfully, but these errors were encountered: