react-testing
Installation
SKILL.md
React Testing
Quick Start
Inspect the installed runner, React and Testing Library versions, setup file, and nearby tests first. Reuse existing helpers. Examples assume runner APIs and jest-dom matchers are configured; see runner setup.
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
test("submits form with user input", async () => {
const user = userEvent.setup();
render(<LoginForm />);
await user.type(screen.getByLabelText(/email/i), "test@example.com");
await user.click(screen.getByRole("button", { name: /sign in/i }));