Files
pipdock/xtask
poli0981andClaude Opus 5 d73ad7eb1d test: generate the L3 mock payloads from the real wire types
TESTING §2 wants the frontend's IPC mocked "with recorded core payloads — the same JSON as
L1 fixtures, guaranteeing UI and core agree on shapes". Hand-writing that JSON defeats the
guarantee it is asking for: rename a field in model.rs and the component tests keep passing
against a shape the app never sends.

So `cargo run -p xtask -- ipc-fixtures` serializes real `Dist`/`OutdatedDist`/`Pin` values
into `ui/src/test/fixtures/`, and a test fails when the committed files no longer match —
the same mechanism and the same reasoning as `bindings.rs`. Verified by breaking one on
purpose: the test names the file and the command that fixes it.

It has already earned itself. `PinMode` is externally tagged, so a `Hold` pin is
`{"hold":{"version":"1.26.4"}}` while an `Exclude` is the bare string `"exclude"`, and
`sizeBytes` is *absent* rather than null on the editable row. Both are things hand-written
mock JSON gets wrong, and both are exactly what the 🔒 chip and the em-dash cell have to
render.

Generated into `ui/` rather than read out of `crates/` behind a Vite alias — same choice
as `generated.ts`, and it saves a build-time path that would have to agree with
vite.config.ts.

A second test guards the fixture *contents*, not just their shape: six rows chosen so that
every rule S2's table implements has a subject — an up-to-date row for dimming, a row with
no size, both pin modes on screen at once, and two of the four outdated rows pinned so
"N pinned excluded" is a real subtraction rather than 0. Editing the scenario without
noticing is how a component test quietly stops covering the case its name claims.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 15:46:48 +07:00
..