testing-library / dom-testing-library

🐙 Simple and complete DOM testing utilities that encourage good testing practices.
https://testing-library.com/dom
MIT License
3.25k stars 463 forks source link

feat(ByRole): Allow filter by disabled state #1221

Open eps1lon opened 1 year ago

eps1lon commented 1 year ago

Part of a larger committment to unify APIs for /react-native and /react (which is just /react-dom at the moment)

What:

Enables ByRole(role, { disabled })

Why:

Makes writing tests for react-native and react-dom easier by removing barriers when changing the target platform that's being tested.

How:

Same patterns as for expanded, selected etc

Checklist:

codesandbox-ci[bot] commented 1 year ago

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 a42f42e3f9cbc2bfc1e6b4534a7047987363a6a1:

Sandbox Source
react-testing-library-examples Configuration
codecov[bot] commented 1 year ago

Codecov Report

Merging #1221 (a42f42e) into main (d09b3c2) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main     #1221   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines         1038      1049   +11     
  Branches       346       353    +7     
=========================================
+ Hits          1038      1049   +11     
Flag Coverage Δ
node-14 100.00% <100.00%> (ø)
node-16 100.00% <100.00%> (ø)
node-18 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/queries/role.ts 100.00% <100.00%> (ø)
src/role-helpers.js 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

jamesonhill commented 1 month ago

Would be super helpful to have this