-
Notifications
You must be signed in to change notification settings - Fork 695
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
Update waitForElementToBeRemoved docs #500
Conversation
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> |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! 🙌
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