Skip to content

Rule no-get-by-for-checking-element-not-present is giving false positives #83

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

Closed
Belco90 opened this issue Feb 11, 2020 · 1 comment · Fixed by #84
Closed

Rule no-get-by-for-checking-element-not-present is giving false positives #83

Belco90 opened this issue Feb 11, 2020 · 1 comment · Fixed by #84
Labels
bug Something isn't working released

Comments

@Belco90
Copy link
Member

Belco90 commented Feb 11, 2020

The rule no-get-by-for-checking-element-not-present is giving false positives for some matchers when it shouldn't.

If you are getting an element with getBy query and asserting something with a negated matcher, it should not complain unless the matcher is toBeInTheDocument (or additional ones checking the element itself is not present).

But if you are asserting something like expect(getByText('Submit')).not.toBeDisabled() the rule should complain about as it's not checking element absence but something else from the element.

@Belco90
Copy link
Member Author

Belco90 commented Feb 11, 2020

🎉 This issue has been resolved in version 2.2.3 🎉

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
bug Something isn't working released
Projects
None yet
1 participant