mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 19:56:18 -04:00
fix(#98): rearm capped race hub refresh
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
focusMeetingKind,
|
||||
focusMeetingLabel,
|
||||
formatCountdown,
|
||||
MAX_BROWSER_TIMEOUT,
|
||||
nextUpcomingMeeting,
|
||||
pickFocusMeeting,
|
||||
refreshDeadlineDelay,
|
||||
@@ -84,4 +85,10 @@ describe('schedule helpers', () => {
|
||||
expect(refreshDeadlineDelay('2025-05-25T13:00:00Z', Date.parse('2025-05-25T12:59:30Z'))).toBe(30_000)
|
||||
expect(refreshDeadlineDelay(undefined)).toBeNull()
|
||||
})
|
||||
|
||||
it('caps a refresh deadline beyond the browser timer maximum', () => {
|
||||
const now = Date.parse('2025-05-25T12:00:00Z')
|
||||
const deadline = new Date(now + MAX_BROWSER_TIMEOUT + 1_000).toISOString()
|
||||
expect(refreshDeadlineDelay(deadline, now)).toBe(MAX_BROWSER_TIMEOUT)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user