react-testlisted
Install: claude install-skill riseshinee/superclaude-react
# react-test
Target: `$ARGUMENTS`
## Flags
| Flag | Meaning |
|---|---|
| `--type unit` | Hooks, utilities, single components |
| `--type integration` | Several components + data layer (MSW) together (default) |
| `--type e2e` | User flows with Playwright/Cypress |
| `--coverage` | Measure coverage and report gaps |
| `--run-only` | Don't write new tests; run and analyze failures only |
## Behavioral Flow
1. **Detect** — Use `react-stack` to find the test runner, config, and commands. If no test tooling exists, don't write tests — propose a setup first (Vite→Vitest, Next→Vitest or Jest). Then get a fresh `react-map` and use it to locate code, following its token budget rules. Lines without ` T` are components with no colocated test.
2. **Learn conventions** — Read 2 existing tests; follow their location (colocated / `__tests__`), render helpers (`renderWithProviders`, …), and mocking style.
3. **Decide what to test** — List user-facing behaviors first: rendered output, interactions, loading/error/empty states, edge cases.
4. **Write** — Follow the principles below.
5. **Run** — Run only the target tests first (e.g. `vitest run path`), then the related suite.
6. **Report** — Cases added, failures/flakiness, coverage gaps.
## Principles (Testing Library)
- **Test behavior, not implementation.** Don't assert on internal state, hook call counts, or class names.
- Query priority: `getByRole` > `getByLabelText` > `getByPlaceholderText` > `getByText` > `getByTestId` (last reso