test(symptoms): register the new surfaces with the export, destructive and success guards

The full-backup route tests mock the symptom definition read the payload
now makes; the destructive-control registry names the symptom hooks (an
entry or a whole symptom, confirmed by an AlertDialog); the symptom quick
entry's save toast is pinned beside the measurement and mood forms it
mirrors.
This commit is contained in:
Marc-André Bombeck committed 2026-10-03 21:38:03 +02:00
1 parent 65b2f75421
commit dbbff339f6
5 files changed
+16

No files matched your search

@@ -331,6 +331,14 @@ const REGISTRY: DestructiveEntry[] = [
recovery: "restorable",
confirm: ["AlertDialog"],
},
{
file: "components/symptoms/use-symptoms.ts",
destroys:
"one logged symptom entry, or a person-defined symptom with every entry of it",
triggers: ["components/symptoms/symptoms-section.tsx"],
recovery: "permanent",
confirm: ["AlertDialog"],
},
{
file: "components/labs/biomarker-manager.tsx",
destroys: "a biomarker AND every lab reading recorded against it",
@@ -289,6 +289,9 @@ const PINNED_AFFORDANCES: Record<
"src/components/mood/manage/tag-groups-card.tsx": { "toast.success": 4 },
"src/components/mood/manage/tag-manager-card.tsx": { "toast.success": 2 },
"src/components/mood/mood-form.tsx": { "toast.success": 1 },
// The symptom quick entry confirms a save exactly as the measurement and
// mood forms beside it do.
"src/components/symptoms/symptom-entry-form.tsx": { "toast.success": 1 },
"src/components/mood/mood-list.tsx": { "toast.success": 3 },
"src/components/onboarding/done-screen.tsx": { CheckCircle2: 2 },
"src/components/records/allergy-form.tsx": { "toast.success": 1 },
@@ -71,6 +71,7 @@ vi.mock("@/lib/db", () => ({
documentConditionLink: { findMany: vi.fn().mockResolvedValue([]) },
extractedFact: { findMany: vi.fn().mockResolvedValue([]) },
ecgRecording: { findMany: vi.fn().mockResolvedValue([]) },
symptomDefinition: { findMany: vi.fn().mockResolvedValue([]) },
// v1.15.0 — cycle tables read by the full-backup helper.
cycleProfile: { findUnique: vi.fn() },
menstrualCycle: { findMany: vi.fn() },
@@ -163,6 +164,7 @@ beforeEach(() => {
vi.mocked(prisma.coachPlan.findMany).mockResolvedValue([] as never);
vi.mocked(prisma.coachReminder.findMany).mockResolvedValue([] as never);
vi.mocked(prisma.ecgRecording.findMany).mockResolvedValue([] as never);
vi.mocked(prisma.symptomDefinition.findMany).mockResolvedValue([] as never);
vi.mocked(prisma.moodTagCategory.findMany).mockResolvedValue([] as never);
vi.mocked(prisma.moodTagHidden.findMany).mockResolvedValue([] as never);
vi.mocked(prisma.mentalHealthAssessment.findMany).mockResolvedValue(
@@ -72,6 +72,7 @@ vi.mock("@/lib/db", () => ({
documentConditionLink: { findMany: vi.fn() },
extractedFact: { findMany: vi.fn() },
ecgRecording: { findMany: vi.fn() },
symptomDefinition: { findMany: vi.fn() },
onboardingRecord: { findUnique: vi.fn().mockResolvedValue(null) },
environmentTravelLocation: { findMany: vi.fn().mockResolvedValue([]) },
environmentContext: { findMany: vi.fn().mockResolvedValue([]) },
@@ -208,6 +209,7 @@ beforeEach(() => {
);
vi.mocked(prisma.extractedFact.findMany).mockResolvedValue([] as never);
vi.mocked(prisma.ecgRecording.findMany).mockResolvedValue([] as never);
vi.mocked(prisma.symptomDefinition.findMany).mockResolvedValue([] as never);
vi.mocked(prisma.userAchievement.findMany).mockResolvedValue([] as never);
});
@@ -63,6 +63,7 @@ vi.mock("@/lib/db", () => ({
documentConditionLink: { findMany: vi.fn().mockResolvedValue([]) },
extractedFact: { findMany: vi.fn().mockResolvedValue([]) },
ecgRecording: { findMany: vi.fn().mockResolvedValue([]) },
symptomDefinition: { findMany: vi.fn().mockResolvedValue([]) },
cycleProfile: { findUnique: vi.fn().mockResolvedValue(null) },
menstrualCycle: { findMany: vi.fn().mockResolvedValue([]) },
cycleDayLog: { findMany: vi.fn().mockResolvedValue([]) },