Skip to content

waitForElement causes test to hang indefinitely in codesandbox #357

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
afholderman opened this issue Apr 17, 2019 · 1 comment
Closed

waitForElement causes test to hang indefinitely in codesandbox #357

afholderman opened this issue Apr 17, 2019 · 1 comment

Comments

@afholderman
Copy link

  • react-testing-library version: 5.8.0
  • react version: 16.8.0
  • node version:
  • npm (or yarn) version:

Relevant code or config:

CodeSandbox repo: https://codesandbox.io/s/8y48jm7rn8

Problem description:

Attempting to use waitForElement in CodeSandbox causes the test to hang indefinitely. In an actual project the issue presented differently with waitForElement never successfully finding the element.

@alexkrolick alexkrolick changed the title waitForElement causes test to hang indefinitely waitForElement causes test to hang indefinitely in codesandbox Apr 17, 2019
@kentcdodds
Copy link
Member

kentcdodds commented Apr 18, 2019

Hi @afholderman,

You were calling waitForElement with the element. You need to call it with a function: https://codesandbox.io/s/o27kw5oly

lucbpz pushed a commit to lucbpz/react-testing-library that referenced this issue Jul 26, 2020
lucbpz pushed a commit to lucbpz/react-testing-library that referenced this issue Jul 26, 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

No branches or pull requests

2 participants