feat(finale): per-project presentation/Q&A durations in m:ss + config-save merge fix
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m30s
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m30s
- setProjectTiming stores per-project overrides in round config; phase starts resolve: explicit input > project override > round default - Run Order rows get m:ss inputs per project; PhaseControls one-off overrides now also m:ss (shared parseClock: '7:30', '12:05', plain '7') - CRITICAL: round.update now MERGES validated form config over the existing configJson — saving the Config tab was wiping projectOrder (would have destroyed a running ceremony) and the finals-docs upload toggle Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* derives the same countdown from cursor timestamps — no client-local clocks.
|
||||
*/
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { elapsedMs, remainingSeconds, formatClock } from '@/lib/live-timer'
|
||||
import { elapsedMs, remainingSeconds, formatClock, parseClock } from '@/lib/live-timer'
|
||||
|
||||
const t0 = new Date('2026-06-11T10:00:00Z')
|
||||
const at = (s: number) => new Date(t0.getTime() + s * 1000)
|
||||
@@ -72,4 +72,20 @@ describe('live-timer', () => {
|
||||
expect(formatClock(0)).toBe('0:00')
|
||||
expect(formatClock(-83)).toBe('+1:23')
|
||||
})
|
||||
|
||||
it('parseClock accepts m:ss, mm:ss and plain minutes', () => {
|
||||
expect(parseClock('7:30')).toBe(450)
|
||||
expect(parseClock('12:05')).toBe(725)
|
||||
expect(parseClock('0:45')).toBe(45)
|
||||
expect(parseClock('7')).toBe(420) // plain minutes
|
||||
expect(parseClock(' 3:00 ')).toBe(180) // tolerant of whitespace
|
||||
})
|
||||
|
||||
it('parseClock rejects garbage', () => {
|
||||
expect(parseClock('')).toBeNull()
|
||||
expect(parseClock('abc')).toBeNull()
|
||||
expect(parseClock('5:75')).toBeNull() // seconds must be 0-59
|
||||
expect(parseClock('-2:00')).toBeNull()
|
||||
expect(parseClock('1:2:3')).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user