mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 05:12:14 +00:00
Three legs, none of which stands alone. `destructive-control-guard.test.ts` is the structural one. A registry names every destructive control, what it takes, and how recoverable that is; three detectors then make FORGETTING to register the failure mode. The obvious guard — every trash icon must sit near a dialog — fails both ways and fails quietly: it misses the control that destroyed the most here, a PUT carrying two empty strings with no trash icon involved, and it cries wolf on the trash icon that drops a row from an unsaved draft. Both classes are live in this tree, and a guard suppressed on half its hits teaches people to suppress it. So the judgement lives in the registry, where it is written down and reviewable, and the mechanism only guarantees that a new control cannot arrive unnoticed and a removed one cannot leave a lie behind. What it cannot do is on the record in the docblock: it cannot prove the registry complete, and it cannot prove an entry true. Skipping a confirmation is possible, but it costs a written argument, and the length floor is enforced. `confirm-button.test.tsx` proves the dismissal contract once, where it belongs: the trigger carries no click handler, the caller's callback reaches exactly one node, the dialog action, and cancel never sees it. An earlier draft also asserted that a closed dialog renders no confirm control; that passed with `open` hard-coded true, because Radix portals do not render server-side at all. It was measuring the renderer, so it is gone rather than left green. `about-me-clear-scope.test.tsx` covers the finding itself: the request carries no allergies key at all, the clearing call reaches the control only as `onConfirm`, and the allergy field stays editable so the targeted way to clear it survives. The existing settings suite grows to name every newly guarded control by slot, plus the threshold override switch, whose off position performed the same irreversible delete as the Reset button beside it. Every assertion was mutation-checked.