test(260610-hbu): drop unused 'now' param in rowForNow helper
This commit is contained in:
@@ -186,25 +186,25 @@ describe('reminderScheduler — catch-up window and missed-tick recovery', () =>
|
||||
|
||||
const sub = { id: 1, userId: 1, endpoint: 'https://push.example.com/1', p256dh: 'k', auth: 'a' }
|
||||
|
||||
function rowForNow(now: Date) {
|
||||
function rowForNow() {
|
||||
return makeEventRow({ uid: 'single-fire-uid', dtstartUtc: eventDtstart, ...sub, subId: sub.id, subUserId: sub.userId, subEndpoint: sub.endpoint, subP256dh: sub.p256dh, subAuth: sub.auth })
|
||||
}
|
||||
|
||||
// Tick at t0 (event 15 min out)
|
||||
vi.setSystemTime(t0)
|
||||
vi.mocked(db.select).mockReturnValue(makeSelectMock([rowForNow(t0)]))
|
||||
vi.mocked(db.select).mockReturnValue(makeSelectMock([rowForNow()]))
|
||||
await runReminderCheck(t0)
|
||||
|
||||
// Tick at t0+1min (event 14 min out — still in window, same uid)
|
||||
const t1 = new Date(t0.getTime() + 60 * 1000)
|
||||
vi.setSystemTime(t1)
|
||||
vi.mocked(db.select).mockReturnValue(makeSelectMock([rowForNow(t1)]))
|
||||
vi.mocked(db.select).mockReturnValue(makeSelectMock([rowForNow()]))
|
||||
await runReminderCheck(t1)
|
||||
|
||||
// Tick at t0+2min (event 13 min out — still in window, same uid)
|
||||
const t2 = new Date(t0.getTime() + 2 * 60 * 1000)
|
||||
vi.setSystemTime(t2)
|
||||
vi.mocked(db.select).mockReturnValue(makeSelectMock([rowForNow(t2)]))
|
||||
vi.mocked(db.select).mockReturnValue(makeSelectMock([rowForNow()]))
|
||||
await runReminderCheck(t2)
|
||||
|
||||
// Exactly one dispatch total: uid dedup prevents re-fire on ticks 2 and 3
|
||||
|
||||
Reference in New Issue
Block a user