Testing library (React): Selecting text in multiple HTML elements
React, Django and SQL developer at Forma.ai
<h3 data-testid="hello-header">Hello <strong>World</strong></h3>
*ByRole
screen.getByRole('heading', { name: 'Hello World' });
or.toHaveTextContent
expect(screen.getByTestId('hello-header')).toHaveTextContent('Hello World');