Getbydisplayvalue React Testing Library May 2026
// Edit the value await userEvent.clear(nameInput); await userEvent.type(nameInput, 'Bob');
const nameInput = screen.getByLabelText(/name/i); getbydisplayvalue react testing library
// Assert updated display value expect(screen.getByDisplayValue('Bob')).toBeInTheDocument(); ); // Edit the value await userEvent
// Assert initial display value expect(screen.getByDisplayValue('Alice')).toBeInTheDocument(); // Edit the value await userEvent.clear(nameInput)