fix(ByRole): Constrain API #1211
Merged
eps1lon merged 3 commits intotesting-library:alphafrom Feb 9, 2023
Merged
Conversation
Only allow `string` as a `role`. Drop support for `exact`, `trim`, `collapseWhitespace`, and `normalizer` options.
|
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 deaeef2:
|
Codecov Report
@@ Coverage Diff @@
## alpha #1211 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 24
Lines 1000 992 -8
Branches 328 322 -6
=========================================
- Hits 1000 992 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
timdeschryver
approved these changes
Feb 7, 2023
Member
timdeschryver
left a comment
There was a problem hiding this comment.
👍 I like the change, I think this guards us against misusage of it and also remove some confusion
Merged
|
Hello! I know byRole often has perf issues when used on large dom nodes. Do you expect this PR to improve the performance? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE: Only allow
stringas arole.Drop support for
exact,trim,collapseWhitespace, andnormalizeroptions.What:
Closes #1202
Why:
Options are not needed as far as I can tell. From the tests we have, it seems to me this encourages rather bad queries. Will ship this soon-ish (since it's just an alpha) to test.
How:
Checklist:
docs site: ByRole: Remove MatchOptions testing-library-docs#1214