feat(prefer-screen-queries): add prefer-screen-queries#99
Merged
Conversation
timdeschryver
commented
Mar 25, 2020
Belco90
requested changes
Mar 25, 2020
Member
Belco90
left a comment
There was a problem hiding this comment.
Awesome! Thank you so much for implementing this one too, really appreciate it. Just added some small requests related to the doc.
docs/rules/prefer-screen-queries.md
Outdated
|
|
||
| ## Rule Details | ||
|
|
||
| This works better with autocomplete and makes each test a little simpler. |
Member
There was a problem hiding this comment.
Could you elaborate little bit more here? Something like:
Suggested change
| This works better with autocomplete and makes each test a little simpler. | |
| DOM Testing Library (and other Testing Library frameworks built on top of it) exports a `screen` object which has every query. This works better with autocomplete and makes each test a little simpler to write and maintain. | |
| This rule aims to force writing tests using queries directly from `screen` object rather than destructuring them from `render` result. |
|
|
||
| ```js | ||
| import { screen } from '@testing-library/any-framework'; | ||
|
|
Member
There was a problem hiding this comment.
Could you add here the render line to have a full example?
Suggested change
| render(<Component />); |
Member
|
I edited to PR to point it to |
eb4f402 to
c100330
Compare
Member
Author
|
No problem! Should be good now, thanks for the review |
Belco90
pushed a commit
that referenced
this pull request
Mar 29, 2020
feat(await-async-utils): reflect waitFor changes (#89) feat: new rule no-wait-for-empty-callback (#94) feat: new rule prefer-wait-for (#88) feat: new rule prefer-screen-queries (#99) BREAKING CHANGE: drop support for node v8. Min version allowed is node v10.12 (#96) BREAKING CHANGE: rule `no-get-by-for-checking-element-not-present` removed in favor of new rule `prefer-presence-queries` (#98) Closes #85 Closes #86 Closes #90 Closes #92 Closes #95 Co-authored-by: timdeschryver <28659384+timdeschryver@users.noreply.github.com>
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.
Closes #95