Skip to content

Document confusing behavior with waitForElementToBeRemoved #409

Open
@kentcdodds

Description

@kentcdodds

So, I added this feature:

- await waitForElementToBeRemoved(() => screen.getByText('foo'))

+ const element = screen.getByText('foo')
+ await waitForElementToBeRemoved(element)

Both work, but the first I think is easier most of the time.

But I just learned that in React applications (and likely other frameworks) the DOM nodes aren't always removed, rather they're updated. So, that cool new feature won't always work as you might expect. I think we should probably document this somewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions