Jest snapshot tests age badly unless you read the diff

A snapshot that fails is regenerated with -u, and after the third time that becomes reflex — at which point the test asserts that the output equals whatever the output currently is.

// a snapshot of an entire rendered tree: fails on any change,
// tells you nothing about which change mattered
expect(render(<Checkout />)).toMatchSnapshot();

// an assertion about behaviour: fails when the behaviour changes
expect(screen.getByRole('button', { name: /pay/i })).toBeEnabled();
expect(onSubmit).toHaveBeenCalledWith({ amount: 4900 });

Snapshots are genuinely useful for small, stable serialisable values — a formatter’s output, a reducer’s next state — and poor for a component tree that changes for cosmetic reasons weekly. The rule worth adopting is that a snapshot must be small enough to read in the diff. Anything larger than a screen has already stopped being a test and become a record.