Closed gndelia closed 4 years ago
Hi @gndelia thanks for reaching us π .
It was a problem with a previous version of @testing-library/dom. It'll be fixed when we'll release a new version of testing-playground.
The problem was that the regex were not escaped.
Stay tuned π
A new version with the fix has been released βΊοΈ
Bug Report π
The "Suggested Query" box breaks when trying to load a
getByText
query if the text includes parenthesis()
. I assume this are not being escaped in this scenario, but they are when showing the example ingetByRole
To Reproduce βοΈ
playground link
it's a simple HTML with the following content
the (correct) suggested query is
The "suggested box" shows
getByText
as a clickable option. However, when I click it, I getand the suggestion box disappears
Expected behavior π€
It should show
in the query box (bottom left). If I type it manually it works, and it suggests the
getByRole
as before, and I can click it. Clicking again thegetByText
breaksSuggested solution π¦
Not sure, I'd have to dig the code π I'd like to take this bug if possible. I guess other regex characters should be escaped as well
Your Environment π»