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

Replace prefer-expect-query-by by better rule #61

Closed
Belco90 opened this issue Jan 17, 2020 · 2 comments · Fixed by #65
Closed

Replace prefer-expect-query-by by better rule #61

Belco90 opened this issue Jan 17, 2020 · 2 comments · Fixed by #65
Labels
help wanted Extra attention is needed new rule New rule to be included in the plugin released

Comments

@Belco90
Copy link
Member

Belco90 commented Jan 17, 2020

Motivated by #59 it looks like we need to replace prefer-expect-query-by* by better implementation to only force users to replace getBy queries by queryBy when:

This should be checked in several cases. A few I can think of at the moment:

  • asserting with .not.toBeInTheDocument()
  • asserting with .toBeNull()
  • asserting with .toBe(null) this is actually an equivalent for the previous one, probably more variations to cover as .toBeFalsy() but I think just this one is enough for now?
  • waiting for disappearance with waitForElementToBeRemoved

I can't think better name for this rule than no-get-by-for-element-absence, any suggestions?

*We could maintain prefer-expect-query-by when the new rule is implemented, but I think it wouldn't be that useful anymore and could even lead to confusion

@Belco90 Belco90 added help wanted Extra attention is needed new rule New rule to be included in the plugin labels Jan 17, 2020
@thomaslombart
Copy link
Collaborator

This rule makes more sense to me. I'll write it next week.
I think the name is fine, I don't have a better idea right now!

About maintaining prefer-expect-query-by, I'm in favour of just replacing it with this rule.

@Belco90
Copy link
Member Author

Belco90 commented Jan 28, 2020

🎉 This issue has been resolved in version 2.0.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
help wanted Extra attention is needed new rule New rule to be included in the plugin released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants