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
Extra space added around embedded expressions in JSX when querying by role + name #591
Extra space added around embedded expressions in JSX when querying by role + name #591
Comments
For some reason, I am having issues running tests in your codesandbox but I think you will find that the cause of the issue is in your hello.js component. |
Hello @pranjaljately! Thank you for your comment! I updated the reproduction case, the space in the |
Thanks, @CarlosGines. I have seen the updated CS and AFAIK the test should not be failing. Any reason why this could be? @kentcdodds |
Hi friends, Thanks for the issue. I'm guessing that's a bug in the calculation of the accessible name. What do you think @eps1lon? |
The expected behavior makes more sense, yes. This is caused by react adding 3 text nodes instead of one and I'll see how we can reconcile these issues. |
Didn't know I github auto-closes issues across repos. #606 will actually close. Otherwise bump |
Awesome! Such a quick reply and fix! Thank you folks! |
🎉 This issue has been resolved in version 7.10.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
@testing-library/dom
version: 7.5.9Relevant code or config:
What you did:
Tried to query an element by role + name
What happened:
The existing element cannot be found.
If the name is in JSX with an embedded expression, potentially inexistent spaces are added around it:
Note the extra space here:
Reproduction:
https://codesandbox.io/s/react-testing-library-demo-09wqi
Problem description:
I cannot create accurate queries in those cases (embedded expressions without surrounding space)
The text was updated successfully, but these errors were encountered: