Claude Code testing-strategy for React prop and callback tests
Choose the test level by observable behavior. Reuse component fixtures to check rendered output and callbacks.
中文Install in Claude Code
Open the TypeScript and React test setup in Claude Code. This component exercise uses the project's Vitest and React Testing Library.
- Review `.claude/skills/testing-strategy/SKILL.md` and its requirements at the pinned GitHub commit.
- Create `.claude/skills/testing-strategy/` in your project and save the reviewed file as `.claude/skills/testing-strategy/SKILL.md`.
- Start Claude Code from that project's root, then select `/testing-strategy` in the slash menu.
Example task
In test-38, EventCard receives {name: 'Garden fair', eventId: 'spring-event'}. The details action should notify the caller with that identifier.What to check
Verify {text: 'Garden fair', callbackValue: 'spring-event'}. Reuse baseline props and override only the data the scenario needs.
Original SKILL.md on GitHub · Updated
Frequently asked question
Should a test assert private state fields?
Prefer rendered output and public callbacks. The same test can then verify the contract after an internal refactor.