diff --git a/tests/integration/routes/parity/__snapshots__/import-json.01-first-file.json.snap b/tests/integration/routes/parity/__snapshots__/import-json.01-first-file.json.snap index 6729dbe05..8662cf5e3 100644 --- a/tests/integration/routes/parity/__snapshots__/import-json.01-first-file.json.snap +++ b/tests/integration/routes/parity/__snapshots__/import-json.01-first-file.json.snap @@ -50,6 +50,20 @@ "2026-10-12T06:00:00.000Z" ] ] + }, + { + "effect": "invalidateStatusInsightsForTypes", + "args": [ + "", + [ + "WEIGHT", + "BLOOD_GLUCOSE", + "SLEEP_DURATION" + ], + { + "source": "manual" + } + ] } ], "stored": { diff --git a/tests/integration/routes/parity/__snapshots__/import-json.02-same-file.json.snap b/tests/integration/routes/parity/__snapshots__/import-json.02-same-file.json.snap index b7e74b5fe..845d804ef 100644 --- a/tests/integration/routes/parity/__snapshots__/import-json.02-same-file.json.snap +++ b/tests/integration/routes/parity/__snapshots__/import-json.02-same-file.json.snap @@ -35,6 +35,20 @@ "", [] ] + }, + { + "effect": "invalidateStatusInsightsForTypes", + "args": [ + "", + [ + "WEIGHT", + "BLOOD_GLUCOSE", + "SLEEP_DURATION" + ], + { + "source": "manual" + } + ] } ], "stored": { diff --git a/tests/integration/routes/parity/import-json.parity.test.ts b/tests/integration/routes/parity/import-json.parity.test.ts index 103565382..265de2378 100644 --- a/tests/integration/routes/parity/import-json.parity.test.ts +++ b/tests/integration/routes/parity/import-json.parity.test.ts @@ -72,6 +72,21 @@ vi.mock("@/lib/jobs/pr-detection", async (importOriginal) => { }; }); +vi.mock("@/lib/insights/status-invalidation", async (importOriginal) => { + const actual = + await importOriginal(); + const { effectRecorder } = await import("../../../kit/parity"); + return { + ...actual, + // Detached from the request but inside its context: run for real, its + // annotate can land on the request's wide event or miss it, depending on + // timing. Recorded instead, like the other tails. + invalidateStatusInsightsForTypes: async (...args: unknown[]) => { + effectRecorder.record("invalidateStatusInsightsForTypes", args); + }, + }; +}); + const prisma = getPrismaClient(); const NOW = new Date("2026-10-15T12:00:00.000Z");