Add race timing and judging regression tests

This commit is contained in:
larssand
2026-08-24 18:58:40 +02:00
parent 1365da7f3c
commit 0ca1679e2a
4 changed files with 566 additions and 1 deletions

View File

@@ -2073,6 +2073,23 @@ npm test
- personal timer aggregate and frozen-window calculations
- clock-skew-safe query normalization and bounds
`tests/race_timing_logic.test.js` covers:
- race-format parsing, defaults, lap limits, participants, and teams
- wizard generation of practice, qualifying, and team-race sessions
- qualifying heat generation and manual-grid-safe reseeding
- final generation, reserved bump slots, and bump-up promotion
- timed, follow-up, and untimed session clocks
- race lap windows and best/consecutive seed metrics
- qualifying points, tie comparisons, and leaderboard gaps
- multi-leg final standings and counted-leg scoring
`tests/judging_logic.test.js` covers:
- cumulative lap/time corrections, reset, and correction-state undo
- manual lap invalidation and competitor-result recalculation
- restoration and undo of passing validity
- safe handling when no counted lap exists
- competitor and judging-log filters
The suite uses Node's built-in `node:test` runner and does not add a test-framework dependency. Windows PowerShell/CMD can run the same suite with `npm.cmd test`.
## 19. Recommended Future Additions
@@ -2082,4 +2099,4 @@ If the project grows further, the next useful additions to this document are:
- exact `settings` schema snapshot
- SQLite table contract section
- controller-to-view ID map for critical forms/buttons
- additional test checklists for race generation, timing, judging, and persistence modules
- additional test checklists for persistence modules