-
Notifications
You must be signed in to change notification settings - Fork 456
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
Test fails if not wrapped into waitFor #1301
Comments
Hi @vincentaudebert, thanks for opening this one. Here's an example that shows it's currently working: |
Hi @MatanBobi Thanks for your reply... The best I managed to get is here: https://stackblitz.com/edit/dtl-template-5xjogm We use our design system Ultraviolet and it seems it fails to work in stackblitz... Could you communicate your guesses so I can check on my side inside our project and I'll post the solution here if I find something... ? Thanks in advance. |
The template I've added is for DTL, if you need React, you can use https://testing-library.com/new-rtl. |
Same issue with RTL :( Only one version of testing-lib/dom user-event is "14.5.2" |
RTL version 14 is using DTL version 9 and not 10. Are you sure you don't have multiple version installed? You can try and upgrade RTL to version 15 which uses DTL 10. |
Thanks a lot @MatanBobi We were still on RTL 14 and it was the issue. Works fine with RTL 15 and DTL 10. |
@testing-library/dom
version: 10.0.0Relevant code or config:
What you did:
Before bumping to testing-library/dom 10.0.0 this test was passing correctly.
Bumping to v10 is the only change.
What happened:
Error: expect(element).toBeChecked()
Received element is not checked:
❯ myfile.test.tsx:72:25
70| ).toBeInTheDocument()
71| await userEvent.click(smsCheckbox)
72| expect(smsCheckbox).toBeChecked()
| ^
73|
74| const smsInput = screen.getByLabelText('some.text')
Problem description:
If I wrap this line into a
await waitFor()
it passes again. Then my tests fail into another file with the same idea, waitFor fixes it...Suggested solution:
No idea where it comes from, if any of you has an idea or same issue? Do I really need to apply
waitFor
everywhere? What could have changed with the v10 to cause this ?Thanks in advance.
The text was updated successfully, but these errors were encountered: