From 311e14c66c9a487e1ae13186159c370cf90e23d9 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 18:02:18 +0000 Subject: [PATCH] test(watch-history): rely on aggregated items from publishRecords Updated `tests/watch-history.test.mjs` to consume `snapshotResult.items` directly, as `WatchHistoryManager`'s `publishRecords` correctly returns aggregated items. Removed the fallback logic and TODO comment that suggested otherwise. This cleanup aligns the test with the current implementation of `WatchHistoryManager` which flattens monthly results into a top-level `items` array. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- tests/watch-history.test.mjs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/watch-history.test.mjs b/tests/watch-history.test.mjs index 88b14b15..530d6cc4 100644 --- a/tests/watch-history.test.mjs +++ b/tests/watch-history.test.mjs @@ -1591,9 +1591,7 @@ async function testWatchHistoryServiceIntegration() { reason: "integration", }); assert.ok(snapshotResult.ok, "snapshot should publish queued pointers"); - // snapshotResult now contains { items: flatItems, results: [monthResults...] } - // or items might be flatItems? - const snapshotItems = snapshotResult.items || (snapshotResult.results || []).flatMap(r => r.items || []); + const snapshotItems = snapshotResult.items || []; // Check if item exists first const snapshotItem = snapshotItems.find(