Snapshot Test Generator
When to Trigger
- •UI component created
- •Data transformation functions
What to Do
- •UI: Render component with representative props (e.g. default, loading, error); toMatchSnapshot() on container or specific wrapper.
- •Data: Call transform with fixed input; assert output with toMatchSnapshot() or explicit expect.
- •Variants: One test per meaningful state (e.g. active, pending, overdue) so snapshots stay focused.
- •Update: Remind that snapshot updates require review; avoid large or noisy snapshots.
Use project test render (e.g. RTL); use factories for props. Prefer small, stable snapshots over one huge file.