Skip to content

Misleading deprecation warning when using waitForElement #677

Closed
testing-library/dom-testing-library
#588
@pelotom

Description

@pelotom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions