Skip to content

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

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

Closed
epmatsw opened this issue Mar 29, 2021 · 3 comments
Closed
Assignees
Milestone

Comments

@epmatsw
Copy link

epmatsw commented Mar 29, 2021

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.

@Belco90 Belco90 self-assigned this Mar 29, 2021
@Belco90
Copy link
Member

Belco90 commented Mar 29, 2021

Hey @epmatsw, thank you very much for your feedback on v4! I think I got a similar issue to this one with no-await-sync-query, and I believe I know where the issue is located in the code.

Belco90 added a commit that referenced this issue Apr 3, 2021
@github-actions
Copy link

github-actions bot commented Apr 3, 2021

🎉 This issue has been resolved in version 4.0.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@MichaelDeBoey MichaelDeBoey added this to the v4 milestone Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants