Description
I use a code that contains an submit button like this:
<input
className="compareHome-submit-button"
type="submit"
value="Retrieve profiles"
/>
With react-testing-library I want to get it using for example getByText('Retrieve profiles')
, which I expect to work because the text 'Retrieve profiles'
is actually seen by users.
But this doesn't work and fails with this error:
Unable to find an element with the text: Retrieve profiles. 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.
Is this error expected in this case? I don't find an easy way to get to the submit button and have to use a matcher function instead...
Metadata
Metadata
Assignees
Labels
No labels