From fb9a4ee616bad9230d4a1507aba202f27d431ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 26 Jul 2026 02:28:14 +0200 Subject: [PATCH] test(sync): follow the tombstone purge's batched outcome shape --- tests/integration/sync-changes.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/integration/sync-changes.test.ts b/tests/integration/sync-changes.test.ts index ef29461fe..64185964c 100644 --- a/tests/integration/sync-changes.test.ts +++ b/tests/integration/sync-changes.test.ts @@ -377,8 +377,10 @@ describe("GET /api/sync/changes (real Postgres)", () => { const pruned = await cleanupExpiredMeasurementTombstones(prisma); // Only the ancient row (deletedAt past the retention horizon) is - // pruned; the recent reachable tombstone survives. - expect(pruned).toBe(1); + // pruned; the recent reachable tombstone survives. `drained` says the + // batched walk reached the end of the backlog rather than stopping at + // its per-run cap. + expect(pruned).toEqual({ deleted: 1, drained: true }); const survivors = await prisma.measurement.findMany({ where: { userId: TEST_USER_ID }, select: { externalId: true },