-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: toHaveAccessibleName and toHaveAccessibleDescription #377
Conversation
Codecov Report
@@ Coverage Diff @@
## main #377 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 26 +2
Lines 584 614 +30
Branches 215 225 +10
=========================================
+ Hits 584 614 +30
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just glanced over it and couldn't spot anything that stands out. Looks good 👍
Co-authored-by: Sebastian Silbermann <[email protected]>
🎉 This PR is included in version 5.14.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What’s the difference between |
Ooohh, I knew I was forgetting something. That one has to be deprecated. It covers only the |
Or maybe I can make it an alias 🤔 I'm leaning more towards deprecation. The upgrade once we remove it in a breaking changes release is straighforward. |
I think whether to make it an alias is a decision on naming convention. For example the matcher for “to be accessibly valid” is named On the other hand, we also have some other APIs which are not for testing a11y. Shortcutting a11y matchers may lead to confusion. |
Valid points. Sometimes it all goes to make some compromises.
I will not claim that I thought about all this beforehand, either. You've certainly made me think about it more now after the fact. Would you say you see something off with the direction we've taken in general? |
I'd prefer reserving |
Fair enough. FWIW, the naming was also influenced by how this feature is named in the very spec that defines it: https://w3c.github.io/accname/ I agree that |
What:
Add two new custom matchers:
toHaveAccessibleName
andtoHaveAccessibleDescription
.Closes #111.
Supersedes #112.
Why:
These enhance the abilities to test a UI with accessibility in mind, and encourage developers to properly label and describe the UI elements in their apps.
How:
The heavy lifting of the work here is delegated to
dom-accessibility-api
.Checklist: