Closed
Description
In https://testing-library.com/docs/guide-disappearance, there's some techniques outlined for waiting for elements to be removed:
test('movie title appears', async () => {
// element is initially not present...
// wait for appearance inside an assertion
await waitFor(() => {
expect(getByText('the lion king')).toBeInTheDocument()
})
})
test('movie title no longer present in DOM', async () => {
// element is removed
await waitForElementToBeRemoved(() => queryByText('the mummy'))
})
Both of these examples are flagged by no-await-sync-query
, and they probably shouldn't be.