Skip to content
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

Get supported roles for toBeChecked via aria-query #267

Merged
merged 2 commits into from Jun 25, 2020

Conversation

tf
Copy link
Contributor

@tf tf commented Jun 25, 2020

Instead of hard coding a list of roles, use information provided by the
aria-query package to determine whether an element with a given role
supports the aria-checked attribute.

Dynamically generate an error message listing all supported roles. Make
error message expectations more fuzzy to prevent test failures if the list
of supported roles should ever change.

Fixes #266

tf added 2 commits June 25, 2020 08:04
Helper to join arrays of strings into natural language enumerations
separating the last two items with a coordinating conjunction like
"and" or "or".
Instead of hard coding a list of roles, use information provided by
the `aria-query` package to determine whether an element with a given
role supports the `aria-checked` attribute.

Dynamically generate an error message listing all supported
roles. Make error message expectations more fuzzy to prevent test
failures if the list of supported roles should ever change.
@codecov
Copy link

codecov bot commented Jun 25, 2020

Codecov Report

Merging #267 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #267   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines          315       320    +5     
  Branches        71        71           
=========================================
+ Hits           315       320    +5     
Impacted Files Coverage Δ
src/to-be-checked.js 100.00% <100.00%> (ø)
src/utils.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0428c5c...e9e6f1c. Read the comment docs.

@gnapse gnapse merged commit c135d0b into testing-library:master Jun 25, 2020
@gnapse
Copy link
Member

gnapse commented Jun 25, 2020

@all-contributors add @tf for code, test, idea

@allcontributors
Copy link
Contributor

@gnapse

I've put up a pull request to add @tf! 🎉

@gnapse
Copy link
Member

gnapse commented Jun 25, 2020

🎉 This PR is included in version 5.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support menuitemcheckbox/menuitemradio roles in toBeChecked
2 participants