From c8b6eb761bafc187e225c479bbbc0774be0e74e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 23 May 2026 10:32:39 +0200 Subject: [PATCH] test(reconcile): align cross-branch fixture drift in v1.4.48 integration - analytics/route.test.ts slim-summaries fixture: mock 4 $queryRaw calls (coverage + allTime + windowed + latest) to match the M0 cold-fallback split shape - dashboard-layout-section hint assertion: anchor on the new L9 shortened German copy ("Pfeiltasten Hoch/Runter") instead of the pre-v1.4.48 phrase --- src/app/api/analytics/__tests__/route.test.ts | 15 +++++++++++---- .../__tests__/dashboard-layout-section.test.tsx | 6 ++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/app/api/analytics/__tests__/route.test.ts b/src/app/api/analytics/__tests__/route.test.ts index 1f7e52261..f18d2b3a5 100644 --- a/src/app/api/analytics/__tests__/route.test.ts +++ b/src/app/api/analytics/__tests__/route.test.ts @@ -305,10 +305,12 @@ describe("GET /api/analytics", () => { // contract the dashboard tile strip reads. it("returns the slim summaries slice when ?slice=summaries is set", async () => { const fiveDaysAgo = new Date(Date.now() - 5 * 24 * 60 * 60 * 1000); - // v1.4.36 — slim slice now opens with a cheap `SELECT COUNT(*) FROM - // measurement_rollups` probe. Force `n: 0` so the route takes the - // legacy heavy-aggregate fallback path that this test's fixtures - // expect (aggregate + latest, two `$queryRaw` passes). + // v1.4.36 — slim slice opens with a cheap `SELECT COUNT(*) FROM + // measurement_rollups` probe; `n: 0` forces the cold-fallback + // path. v1.4.48 M0 split that path's single aggregate query into + // two parallel ones (all-time + windowed), so the cold fixture + // now mocks 4 `$queryRaw` calls: coverage + allTime + windowed + + // latest. vi.mocked(prisma.$queryRaw) .mockResolvedValueOnce([{ n: BigInt(0) }] as never) .mockResolvedValueOnce([ @@ -318,6 +320,11 @@ describe("GET /api/analytics", () => { min_value: 80.0, max_value: 84.5, mean_value: 82.1, + }, + ] as never) + .mockResolvedValueOnce([ + { + type: "WEIGHT", avg7: 82.0, avg30: 82.2, slope7: -0.05, diff --git a/src/components/settings/__tests__/dashboard-layout-section.test.tsx b/src/components/settings/__tests__/dashboard-layout-section.test.tsx index 8882eac33..2e2d9922c 100644 --- a/src/components/settings/__tests__/dashboard-layout-section.test.tsx +++ b/src/components/settings/__tests__/dashboard-layout-section.test.tsx @@ -130,8 +130,10 @@ describe(" — drag-and-drop reorder", () => { it("hint string localises to German", () => { const html = render(, "de"); - // Anchor on a stable German fragment from the hint copy. - expect(html).toContain("Ziehe den Griff"); + // v1.4.48 L9 — copy trimmed to ~12 words so screen readers do + // not spend ~6 s reading the hint on focus. Anchor on the + // shortened phrase. + expect(html).toContain("Pfeiltasten Hoch/Runter"); }); });