fix(race-day): reset a heat to ready with its clock at zero, keep recent races listed (1.45.2)

This commit is contained in:
larssand committed 2026-11-01 10:49:17 +01:00
1 parent 7376595001
commit ab1c26a89b
7 files changed
+62 -14

No files matched your search

+9 -2
View File
@@ -25,9 +25,16 @@ test("Race Day picker: today's races, live and selected sessions, grouped per ra
["old", ["old_practice"]],
["next", ["n_practice"]],
["today", ["t_practice", "t_q1"]],
["undated", ["u_ready"]],
["undated", ["u_ready", "u_done"]],
]);
assert.equal(result.hidden, 2);
assert.equal(result.hidden, 1);
});
test("Race Day picker: a race run in the last 12 hours stays listed after midnight", () => {
const now = Date.parse("2026-11-09T00:30:00");
const ran = sessions.map((session) => session.id === "t_practice" ? { ...session, startedAt: now - 3600 * 1000 } : session);
const result = buildRaceDaySessionGroups({ sessions: ran, events, today: "2026-11-09", now });
assert.deepEqual(ids(result).find(([id]) => id === "today"), ["today", ["t_practice", "t_q1"]], "yesterday's race, finished heats included");
});
test("Race Day picker: show all lists every session", () => {