diff --git a/src/__tests__/aging-fixture-dates-guard.test.ts b/src/__tests__/aging-fixture-dates-guard.test.ts index ba785e961..84a21a76c 100644 --- a/src/__tests__/aging-fixture-dates-guard.test.ts +++ b/src/__tests__/aging-fixture-dates-guard.test.ts @@ -83,6 +83,11 @@ const ALLOWLIST: Record = { reason: "the discovery matrix reads from a fixed since forward; the fixture days stay inside it as now moves on", }, + "tests/integration/dense-series-dst-hour.test.ts": { + max: 1, + reason: + "the read starts at a fixed fall-back night and runs forward to now; the readings are pinned to that night, so the case cannot age", + }, }; export interface AgingFinding { diff --git a/src/app/api/measurements/series/__tests__/route.test.ts b/src/app/api/measurements/series/__tests__/route.test.ts index 0742d921b..ea63202db 100644 --- a/src/app/api/measurements/series/__tests__/route.test.ts +++ b/src/app/api/measurements/series/__tests__/route.test.ts @@ -131,7 +131,7 @@ function req(query: string): NextRequest { * `tests/integration/series-source-ladder.test.ts`. */ function adaptSeriesSql(sql: string): Promise { - if (/GROUP BY local_day|STDDEV_POP/.test(sql)) { + if (/GROUP BY (?:local_day|bucket_start)|STDDEV_POP/.test(sql)) { return (prisma.$queryRaw as unknown as () => Promise)(); } const type = /'([A-Z0-9_]+)'::"measurement_type"/.exec(sql)?.[1]; @@ -914,7 +914,7 @@ describe("GET /api/measurements/series — dense-kind day-bucketing (v1.28.25)", const bucketCall = vi .mocked(prisma.$queryRawUnsafe) .mock.calls.find(([sql]) => - /GROUP BY local_day/.test(sql as string), + /GROUP BY (?:local_day|bucket_start)/.test(sql as string), ) as unknown[]; expect(bucketCall.slice(1)).toContain("hour"); }); @@ -981,7 +981,7 @@ describe("GET /api/measurements/series — dense-kind day-bucketing (v1.28.25)", const bucketCall = vi .mocked(prisma.$queryRawUnsafe) .mock.calls.find(([sql]) => - /GROUP BY local_day/.test(sql as string), + /GROUP BY (?:local_day|bucket_start)/.test(sql as string), ) as unknown[]; expect(bucketCall.slice(1)).toContain("hour"); });