From 13c74c4e9226f091366a92861e9b5d6fd22fc1ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 16 Oct 2026 05:44:17 +0200 Subject: [PATCH] test(targets): pin the resting pulse verdict below a default band as hold --- src/app/api/insights/targets/__tests__/route.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/api/insights/targets/__tests__/route.test.ts b/src/app/api/insights/targets/__tests__/route.test.ts index ed3041d2a..d9fe9db14 100644 --- a/src/app/api/insights/targets/__tests__/route.test.ts +++ b/src/app/api/insights/targets/__tests__/route.test.ts @@ -39,6 +39,11 @@ vi.mock("@/lib/targets/glucose-read", async (importOriginal) => ({ vi.mock("@/lib/analytics/resting-pulse-read", () => ({ readRestingPulseProxy: vi.fn(), })); +// The verdict's basis: the dashboard's summary slice. Empty here, so every +// item is placed with its own value (`targetVerdictReference`). +vi.mock("@/lib/analytics/summaries-slice", () => ({ + computeSummariesSlice: vi.fn(async () => ({ summaries: {} })), +})); vi.mock("@/lib/db", () => ({ prisma: { @@ -596,12 +601,15 @@ describe("GET /api/insights/targets — mood-rollup tier swap", () => { color: "var(--warning)", }, source: "CDC/NCHS", + // Below a default band nobody chose, a resting pulse holds: its + // lower edge is a convention, not a goal to climb back to, so a + // steady reading is the good news and no move is a setback. direction: { - direction: "up-good", + direction: "hold", targetPosition: "below", basis: "profile_default", }, - trendSentiment: "neutral", + trendSentiment: "positive", daysInRange7d: 0, daysLogged7d: 4, daysInRange30d: 0,