diff --git a/api/test/services/digest-service.test.ts b/api/test/services/digest-service.test.ts index 6cffda7d..297c7592 100644 --- a/api/test/services/digest-service.test.ts +++ b/api/test/services/digest-service.test.ts @@ -302,7 +302,13 @@ test("sendDueDigests: an empty digest isn't sent, a late one covers the last per assert(windowOf(quiet.id, "weekly")! > ago(2 * DAY)); const late = await createUser({ createdAt: ago(60 * DAY) }); - const d = insertDump({ userId: quiet.id, title: "Recent" }); + // Dated in the past: a dump posted in the very millisecond the run takes + // as `now` falls outside the window, which ends before it. + const d = insertDump({ + userId: quiet.id, + title: "Recent", + createdAt: ago(DAY), + }); vote(d.id, 1); schedule(late.id, "weekly", ago(5 * PERIOD_MS.weekly)); const local = await createUser({