Discard items left in their pickup box past a 15-minute window
An item's pickup window starts when it goes into its box. Once it runs out, the item is discarded without a refund and the box is freed; a box that's open at that moment is left alone. With no scheduler yet, reads, box actions and the kitchen simulation check for expired items first. The order card shows a live countdown under "Ready for pickup" and a "Not picked up in time" banner once discarded. Also bounces the lock icon and animates the pickup button's label changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+18
-1
@@ -1,6 +1,11 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { formatDuration, formatEtaClock, formatEtaParts } from '#/lib/format.ts'
|
||||
import {
|
||||
formatCountdown,
|
||||
formatDuration,
|
||||
formatEtaClock,
|
||||
formatEtaParts,
|
||||
} from '#/lib/format.ts'
|
||||
|
||||
describe('formatDuration', () => {
|
||||
it('rounds up to at least 1 minute', () => {
|
||||
@@ -64,3 +69,15 @@ describe('formatEtaParts', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('formatCountdown', () => {
|
||||
it('shows minutes and zero-padded seconds, rounding up', () => {
|
||||
expect(formatCountdown(15 * 60 * 1000)).toBe('15:00')
|
||||
expect(formatCountdown(65_500)).toBe('1:06')
|
||||
expect(formatCountdown(9_000)).toBe('0:09')
|
||||
})
|
||||
|
||||
it('stops at zero once the time is up', () => {
|
||||
expect(formatCountdown(-5_000)).toBe('0:00')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user