Skip to content

feat(prefer-find-by): report waitFor with presence matchers #420

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
zaicevas opened this issue Jul 19, 2021 · 1 comment · Fixed by #450
Closed

feat(prefer-find-by): report waitFor with presence matchers #420

zaicevas opened this issue Jul 19, 2021 · 1 comment · Fixed by #450
Labels
enhancement New feature or request released

Comments

@zaicevas
Copy link
Contributor

Originally mentioned in #411 (comment)

prefer-find-by could report presence matchers (.toBeInTheDocument(), toBeDefined(), etc) that are used in conjunction with RTL queries. Currently, prefer-find-by does not report such cases:

    await waitFor(() => screen.getByText('button')) // reported
    await waitFor(() => expect(screen.getByText('button')).toBeInTheDocument()) // not reported
@MichaelDeBoey MichaelDeBoey added the enhancement New feature or request label Jul 19, 2021
@MichaelDeBoey MichaelDeBoey changed the title Extend prefer-find-by to report waitFor with presence matchers feat(prefer-find-by): report waitFor with presence matchers Jul 19, 2021
Belco90 pushed a commit that referenced this issue Aug 24, 2021
* feat: report presence matchers

* refactor: split two functions

* refactor: split big if statement

* refactor: split two functions

* refactor: improve variable names

* Add example in docs

* refactor: remove redundant comments

* Refactor else if -> if

* test: add test case with an allowed assertion

Co-authored-by: Michaël De Boey <[email protected]>

Closes #420
@github-actions
Copy link

🎉 This issue has been resolved 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
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants