Closed
Description
Describe the feature you'd like:
Given the following markup:
<div>Hello<br />World</div>
considering that innerText
of the above element would be "Hello\nWorld"
(see this JSFiddle), I expect that I would be able to use this query:
screen.getByText("Hello\nWorld");
but it throws the following error:
TestingLibraryElementError: Unable to find an element with the text: Hello
World. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
Suggested implementation:
Describe alternatives you've considered:
I've considered using a custom function, like the error message suggests, but this is my first experience with Testing Library, and I don't really know how to do it yet.
And since it's a simple case, I would rather like to use a simple query, without providing any custom functions.
Teachability, Documentation, Adoption, Migration Strategy:
Metadata
Metadata
Assignees
Labels
No labels