Skip to content

feat(role): support {pressed: true} for buttons #729

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

Conversation

jluxenberg
Copy link
Collaborator

Hat tip to Sebastian Silbermann for his prior work on PR #692

What: Adds support for querying based on aria-pressed state for elements with a role of "button" (see https://www.w3.org/TR/wai-aria-1.1/#aria-pressed)

Why: aria-checked and aria-selected area already supported; adding the ability to query by aria-pressed should round out support for querying by these types of parameters.

How: This is implemented in exactly the same fashion as Sebastian Silbermann's implementation in PR #692.

Checklist:

  • Documentation added to the
    docs site
  • Tests
  • Typescript definitions updated
  • Ready to be merged

Hat tip to Sebastian Silbermann for his prior work on PR testing-library#692
@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 6, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7b48e4f:

Sandbox Source
kentcdodds/react-testing-library-examples Configuration

@codecov
Copy link

codecov bot commented Aug 6, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #729   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines          651       657    +6     
  Branches       170       173    +3     
=========================================
+ Hits           651       657    +6     
Impacted Files Coverage Δ
src/queries/role.js 100.00% <100.00%> (ø)
src/role-helpers.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 ed87ae9...7b48e4f. Read the comment docs.

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful :chefs-kiss: thanks!

@kentcdodds kentcdodds merged commit 372ac60 into testing-library:master Aug 6, 2020
@kentcdodds
Copy link
Member

@all-contributors please add @jluxenberg for code and tests

@allcontributors
Copy link
Contributor

@kentcdodds

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

@kentcdodds
Copy link
Member

Thanks so much for your help! I've added you as a collaborator on the project. Please make sure that you review the other/MAINTAINING.md and CONTRIBUTING.md files (specifically the bit about the commit messages and the git hooks) and familiarize yourself with the code of conduct (we're using the contributor covenant). You might also want to watch the repo to be notified when someone files an issue/PR. Please continue to make PRs as you feel the need (you can make your branches directly on the repo rather than your fork if you want). Thanks! And welcome to the team :)

@kentcdodds
Copy link
Member

🎉 This PR is included in version 7.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jluxenberg
Copy link
Collaborator Author

@kentcdodds FYI I didn't realize the docs site was separate; I'm opening a PR for the update to the docs now.

@kentcdodds
Copy link
Member

Great, thank you!

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.

2 participants