Unit Testing in React
React Testing Library: render(<Comp />), screen.getByRole / getByText, userEvent.click, assert the text/role the user sees. Jest or Vitest runs it. Test behaviour, not implementation (not wrapper.state(), not CSS class internals).
Example: Counter — click Increment, expect ‘1’ on screen. That’s a unit-style component test. MSW mocks network. Don’t snapshot the entire HTML of a page as your only test.
Unit Testing in React — output — render / click / assert text. Don’t test implementation details like state keys.
RTL render + userEvent + assert text.