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

Update waitForElementToBeRemoved docs #500

Conversation

tjefferson08
Copy link
Contributor

To match the recent change to its return type (and TS typedef)

Original issue: dom-testing-library issue #610

A note for reviewers, it looks like the linting hooks have made some extra changes here, I'll throw a comment to highlight my intended (much smaller!) change

To match the recent change to its return type (and TS typedef)

Original issue: dom-testing-library issue testing-library#610
@@ -63,24 +63,24 @@ function waitForElementToBeRemoved<T>(
interval?: number
mutationObserverOptions?: MutationObserverInit
}
): Promise<T>
): Promise<void>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Intended change here!

```

To wait for the removal of element(s) from the DOM you can use
`waitForElementToBeRemoved`. The `waitForElementToBeRemoved` function is a small
wrapper around the `wait` utility.
wrapper around the `waitFor` utility.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

And here!


Here is an example where the promise resolves with `true` because the element is
removed:
Here is an example where the promise resolves because the element is removed:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

And here (that's it!)

Copy link
Member

@afontcu afontcu left a comment

Choose a reason for hiding this comment

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

Thanks for this! 🙌

@afontcu afontcu merged commit 8a71e49 into testing-library:master Jun 20, 2020
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 this pull request may close these issues.

None yet

2 participants