Skip to content

[v4][no-await-sync-query] False positives on appearance/disappearance examples #304

Closed
@epmatsw

Description

@epmatsw

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions