test(sync): follow the tombstone purge's batched outcome shape

This commit is contained in:
Marc-André Bombeck committed 2026-07-26 14:04:44 +02:00
1 parent dccd2f320b
commit fb9a4ee616
1 file changed
+4 -2
+4 -2
View File
@@ -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 },