Code RoomSnapshot tests don't catch regressions
MediumPrep Room Coding #4089

Snapshot tests don't catch regressions

Vibe & agenticAlgorithms & data structuresMid–Senior~14 min

An AI agent added Jest snapshot tests across your React component library to 'lock in behavior fast' and boost coverage before a refactor. It generated ~40 expect(render(<X {...props} />)).toMatchSnapshot() tests, all passing, and committed the .snap files. Your lead is pleased with the coverage jump. What are the risks of relying on these AI-generated snapshot tests as your safety net, and how would you make the suite actually protective?

Implement
review_snapshot_diff(before: list[str], after: list[str]) → list[str]
Examples
in[["class=btn primary","aria-disabled=false","text=Submit"],["class=primary btn","aria-disabled=false","text=Submit"]]out[]
in[["aria-disabled=true","text=Save"],["text=Save"]]out["aria-disabled"]
in[["role=button","text=Save"],["role=button","text=Saved"]]out["text"]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 14 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.