From e2f9039f282193963ab2987127782a742d2665af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 7 Jun 2026 18:25:39 +0200 Subject: [PATCH] test(health-score): update BP-pillar integration assertion for graded scoring --- tests/integration/analytics-health-score.test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/integration/analytics-health-score.test.ts b/tests/integration/analytics-health-score.test.ts index 1d324c9eb..b6e8a5cea 100644 --- a/tests/integration/analytics-health-score.test.ts +++ b/tests/integration/analytics-health-score.test.ts @@ -238,9 +238,15 @@ describe("GET /api/analytics — Health Score", () => { }; expect(env.data!.healthScore).not.toBeNull(); const hs = env.data!.healthScore!; - // The BP pillar must score from the all-time window… + // The BP pillar must score from the all-time window (recency-weighted)… + // 122/78 sits just inside the under-65 target ceiling (129/79), so the + // graded clinical-proximity score lands high (worst-of-axis ≈ 86) rather + // than the old binary 100. The point of this test is that the pillar still + // SCORES from all-time history when the trailing-30-day window is empty — + // a clearly in-target history must read as a strong (≥ 80) pillar, not drop + // out entirely (the regression this test pins). expect(hs.components.bp.value).not.toBeNull(); - expect(hs.components.bp.value).toBeGreaterThanOrEqual(90); + expect(hs.components.bp.value).toBeGreaterThanOrEqual(80); expect(hs.components.bp.weight).toBeGreaterThan(0); // …while the tile headline stays scoped to the trailing 30 days // (no readings there → null), proving the two are decoupled.