Skip to content

feat(prefer-find-by): report presence assertions #450

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

Merged
merged 11 commits into from
Aug 24, 2021

Conversation

zaicevas
Copy link
Contributor

@zaicevas zaicevas commented Aug 9, 2021

Checks

  • I have read the contributing guidelines.
  • If some rule is added/updated/removed, I've regenerated the rules list.
  • If some rule meta info is changed, I've regenerated the plugin shared configs.

Changes

  • Enhances prefer-find-by by reporting presence assertions

Context

Closes #420
Not gonna lie, took much more effort and AST parsing than I initially thought 😄

@Belco90
Copy link
Member

Belco90 commented Aug 11, 2021

@zaicevas oh wow, it seems complex indeed!

I'll try to take a look at the end of the week, thanks ✨

Copy link
Member

@Belco90 Belco90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks great in general! I just requested an additional test.

The implementation to detect the waitFor + presence/absence assertion seems a bit brittle since it's too tight to a particular tree. But I guess this is what it is, right?

I'm surprised the auto-fix works for this new invalid usage reported 😮

@zaicevas
Copy link
Contributor Author

The implementation to detect the waitFor + presence/absence assertion seems a bit brittle since it's too tight to a particular tree. But I guess this is what it is, right?

Yeah :S I guess one can't escape that.

I'm surprised the auto-fix works for this new invalid usage reported 😮

Yep, that's because it relies on a few variables (such as queryMethod, queryVariant) so it was enough to fill these properly.


I've noticed github actions are failing because of what seems to be unrelated reasons. Would you mind helping with that?

Copy link
Member

@Belco90 Belco90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good from my side. Thanks again!

@Belco90 Belco90 merged commit 94758f1 into testing-library:main Aug 24, 2021
@github-actions
Copy link

🎉 This PR is included in version 4.12.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(prefer-find-by): report waitFor with presence matchers
3 participants