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

Misleading deprecation warning when using waitForElement #677

Closed
pelotom opened this issue May 27, 2020 · 2 comments · Fixed by testing-library/dom-testing-library#588
Closed

Comments

@pelotom
Copy link

pelotom commented May 27, 2020

The current deprecation warning is misleading:

`waitForElement` has been deprecated. Use a `find*` query (preferred:
https://testing-library.com/docs/dom-testing-library/api-queries#findby) or
use `waitFor` instead (it's the same API, so you can find/replace):
https://testing-library.com/docs/dom-testing-library/api-async#waitfor

Specifically, the suggestion to "use waitFor instead (it's the same API, so you can find/replace)". I tried doing a find/replace and ran into a bunch of errors, because they are not equivalent: waitForElement's promise will not resolve until you return something truthy.

@kentcdodds
Copy link
Member

True. Thanks for the issue. Would you like to help by fixing that?

@pelotom
Copy link
Author

pelotom commented May 27, 2020

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants