Getbydisplayvalue React Testing Library ((hot)) File

// Assert updated display value expect(screen.getByDisplayValue('Bob')).toBeInTheDocument(); );

test('select element by display value', () => render(<RoleSelect defaultValue="Admin" />); getbydisplayvalue react testing library

// Assert initial display value expect(screen.getByDisplayValue('Alice')).toBeInTheDocument(); // Assert updated display value expect(screen

const nameInput = screen.getByLabelText(/name/i); test('select element by display value'

// Edit the value await userEvent.clear(nameInput); await userEvent.type(nameInput, 'Bob');

// Assert updated display value expect(screen.getByDisplayValue('Bob')).toBeInTheDocument(); );

test('select element by display value', () => render(<RoleSelect defaultValue="Admin" />);

// Assert initial display value expect(screen.getByDisplayValue('Alice')).toBeInTheDocument();

const nameInput = screen.getByLabelText(/name/i);

// Edit the value await userEvent.clear(nameInput); await userEvent.type(nameInput, 'Bob');