-
Notifications
You must be signed in to change notification settings - Fork 221
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
ExternalHyperlink button causes @testing-library/react getByRole('link') queries to hang with v11 of Canvas Kit #3032
Comments
When you say “hangs”, I think it is because you’re using The <ExternalHyperlink href="https://google.com">Some Link</ExternalHyperlink> This has the accessible name computed to:
The external icon has this label for accessibility to inform screen reader users that the link opens in a new window. The icon is for visual users to know it opens in a new window. |
If you wish to not include the "Opens link in new window" in your expect(
await screen.findByRole('link', { name: /Click me!/ })
).toBeDefined(); |
I did know about the extra label but I forgot! https://stackblitz.com/edit/canvas-kit-react-v11-starter-w7cqqu-9gfiwe?file=src%2FApp.test.tsx updated but it still never actually times out (from what I can tell!) |
https://stackblitz.com/edit/canvas-kit-react-v10-starter-pbwauw?file=src%2FApp.test.tsx is a Stackblitz with all the same tests / happy-dom / vitest config, and the tests pass |
looks like v12 passes 🤯 https://stackblitz.com/edit/canvas-kit-react-v12-starter-w7cqqu-xnx6x3?file=src%2FApp.test.tsx |
Nicholas spotted that the problem here is actually I can raise something on the Thanks for the investigation ❤️ |
Closing this in favour of capricorn86/happy-dom#1593, workarounds listed above! |
🐛 Bug Report
ExternalHyperlink button causes @testing-library/react getByRole('link') queries to hang with v11 of Canvas Kit
To Reproduce
test.only
to isolate the 2 different test specs and try them outnpm i; npm test
The test for reference:
Expected Behavior
Both tests should pass
Actual Results
Test using Canvas Kit ExternalHyperlink button fails
Link to repl or repo (highly encouraged)
⬆️
Error Output
no error, the test just hangs
The text was updated successfully, but these errors were encountered: