From cad4c89831c22706dcbc44fa889479fb6e8d8ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 12 Nov 2026 12:53:36 +0100 Subject: [PATCH] test: mark the visit, dose and address-book deletes restorable The three deletes gained an Undo toast that calls the restore route, but the destructive-control registry still listed them as tombstoned with no restore, with comments saying they would become restorable the day a surface offered the undo. The correlation card test's header still described the disabled "Coming soon" action it no longer tests. --- src/__tests__/destructive-control-guard.test.ts | 13 +++++-------- .../insights/__tests__/correlation-card.test.tsx | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/__tests__/destructive-control-guard.test.ts b/src/__tests__/destructive-control-guard.test.ts index 3bdc790fb..762adce82 100644 --- a/src/__tests__/destructive-control-guard.test.ts +++ b/src/__tests__/destructive-control-guard.test.ts @@ -469,17 +469,15 @@ const REGISTRY: DestructiveEntry[] = [ destroys: "a visit with its reason, outcome and the links it collected — and, for a booked one, the appointment reminder that would have nudged about it", triggers: ["components/encounters/encounter-sheet.tsx"], - // The route soft-deletes and a restore route exists, but nothing in the - // product reaches it yet, so from a person's side the visit is gone. This - // becomes "restorable" the day a surface offers the undo, not before. - recovery: "tombstoned-no-restore", + // The delete toast offers the Undo that calls the restore route. + recovery: "restorable", confirm: ["AlertDialog"], }, { file: "hooks/use-practitioners.ts", destroys: "one address-book entry", triggers: ["components/practitioners/practitioner-list.tsx"], - recovery: "tombstoned-no-restore", + recovery: "restorable", confirm: ["AlertDialog"], }, { @@ -487,9 +485,8 @@ const REGISTRY: DestructiveEntry[] = [ destroys: "one logged dose with its lot, site and the document links it collected — the booster reminder it once satisfied is deliberately not rewound", triggers: ["components/vaccinations/vaccination-sheet.tsx"], - // The route soft-deletes and a restore route exists, but no surface offers - // the undo yet, so from a person's side the dose is gone. - recovery: "tombstoned-no-restore", + // The delete toast offers the Undo that calls the restore route. + recovery: "restorable", confirm: ["AlertDialog"], }, diff --git a/src/components/insights/__tests__/correlation-card.test.tsx b/src/components/insights/__tests__/correlation-card.test.tsx index c6d067910..dfb19997c 100644 --- a/src/components/insights/__tests__/correlation-card.test.tsx +++ b/src/components/insights/__tests__/correlation-card.test.tsx @@ -7,9 +7,9 @@ import type { CorrelationResult } from "@/lib/insights/correlations"; * v1.4.20 — `` rendering. * * Tests cover: - * 1. OK status renders title + interpretation + source chip + disabled CTA. + * 1. OK status renders title + interpretation + source chip. * 2. Insufficient status renders the empty-state instead. - * 3. CTA is `disabled` and exposes the "Coming soon" tooltip via `title`. + * 3. The card offers no placeholder action, only ones that work. * 4. Confidence chip surfaces high / moderate / low. * 5. Locale-aware copy (EN / DE). */