From a598b000817ca2675fab5c12149e185990f3bae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Tue, 3 Nov 2026 22:25:43 +0100 Subject: [PATCH] test(coach): start every snapshot case with no readings The query-shape case read the measurement mock without setting it and passed only after a case that left rows behind. --- src/lib/ai/coach/__tests__/snapshot-new-metrics.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/ai/coach/__tests__/snapshot-new-metrics.test.ts b/src/lib/ai/coach/__tests__/snapshot-new-metrics.test.ts index 97f0e68be..1d4c27189 100644 --- a/src/lib/ai/coach/__tests__/snapshot-new-metrics.test.ts +++ b/src/lib/ai/coach/__tests__/snapshot-new-metrics.test.ts @@ -94,6 +94,9 @@ describe("buildCoachSnapshot — Apple Health additive metrics (v1.4.23)", () => // for 60 s; reset between tests so each fixture is read fresh. __resetCoachSnapshotCacheForTests(); resolveModuleMapMock.mockResolvedValue(allModulesEnabled()); + // No readings unless a case seeds its own; the case that only inspects + // the query used to inherit whatever rows the case before it left. + prismaMock.measurement.findMany.mockResolvedValue([]); prismaMock.moodEntry.findMany.mockResolvedValue([]); prismaMock.medicationIntakeEvent.findMany.mockResolvedValue([]); prismaMock.medication.findMany.mockResolvedValue([]);