1
ReactIntermediate#accessibility
Render with React Testing Library and assert on what the user sees, querying by role or label rather than implementation details, and use userEvent for interactions.
render(<Login />);
await userEvent.type(screen.getByLabelText('Email'), 'a@b.com');
await userEvent.click(screen.getByRole('button', { name: /log in/i }));
expect(screen.getByText(/welcome/i)).toBeInTheDocument();