From c5fcd50cc090991ac886b99f0be0589805f8f6f1 Mon Sep 17 00:00:00 2001 From: sudacode Date: Sat, 28 Mar 2026 12:12:58 -0700 Subject: [PATCH] Fix monthly rollup test expectations - Preserve multi-arg Date construction in mock helper - Align rollup assertions with the correct videoId --- .../immersion-tracker/__tests__/query.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/services/immersion-tracker/__tests__/query.test.ts b/src/core/services/immersion-tracker/__tests__/query.test.ts index 992e3c5..de56cec 100644 --- a/src/core/services/immersion-tracker/__tests__/query.test.ts +++ b/src/core/services/immersion-tracker/__tests__/query.test.ts @@ -90,7 +90,7 @@ function withMockDate(fixedDate: Date, run: (realDate: typeof Date) => T): T if (args.length === 0) { super(fixedDateMs); } else { - super(args[0]); + super(...(args as [any?, any?, any?, any?, any?, any?, any?])); } } @@ -1516,11 +1516,11 @@ test('getMonthlyRollups derives rate metrics from stored monthly totals', () => const rows = getMonthlyRollups(db, 1); assert.equal(rows.length, 2); const rowsByVideoId = new Map(rows.map((row) => [row.videoId, row])); - assert.equal(rowsByVideoId.get(2)?.cardsPerHour, 30); - assert.equal(rowsByVideoId.get(2)?.tokensPerMin, 3); - assert.equal(rowsByVideoId.get(2)?.lookupHitRate ?? null, null); - assert.equal(rowsByVideoId.get(1)?.cardsPerHour ?? null, null); - assert.equal(rowsByVideoId.get(1)?.tokensPerMin ?? null, null); + assert.equal(rowsByVideoId.get(1)?.cardsPerHour, 30); + assert.equal(rowsByVideoId.get(1)?.tokensPerMin, 3); + assert.equal(rowsByVideoId.get(1)?.lookupHitRate ?? null, null); + assert.equal(rowsByVideoId.get(2)?.cardsPerHour ?? null, null); + assert.equal(rowsByVideoId.get(2)?.tokensPerMin ?? null, null); } finally { db.close(); cleanupDbPath(dbPath);