Getbydisplayvalue React — Testing Library =link=

await userEvent.type(screen.getByLabelText(/name/i), 'Jane Smith'); expect(screen.getByDisplayValue('Jane Smith')).toBeInTheDocument();

The method returns a single element that matches the provided TextMatch (string, regex, or function). If no match is found, it throws an error. Testing Library ByDisplayValue - Testing Library getbydisplayvalue react testing library