diff --git a/src/matchers/__tests__/to-have-text-content.test.tsx b/src/matchers/__tests__/to-have-text-content.test.tsx index 3e4155a8..3dd5e1cb 100644 --- a/src/matchers/__tests__/to-have-text-content.test.tsx +++ b/src/matchers/__tests__/to-have-text-content.test.tsx @@ -7,11 +7,16 @@ it('verifies element has expected text content', async () => { const Component = () => ( Hello World + Other Text ); await render(); const element = screen.getByTestId('text-element'); + const otherElement = screen.getByTestId('other-element'); + expect(element).toHaveTextContent('Hello World'); + expect(element).not.toHaveTextContent('Other Text'); + expect(otherElement).not.toHaveTextContent('Hello World'); });