fix(day): a heat already run between pending ones no longer gives every later heat the same time (1.89.16)
This commit is contained in:
1 parent
5b34317bcb
commit
cb29c5471b
5 files changed
+30
-6
No files matched your search
@@ -157,3 +157,16 @@ test("the drivers' board shows the lunch while it is on, and before the heat aft
|
||||
const before = renderDriverBoard({ t: (k) => k, escapeHtml: String, date: "2026-11-08", rows, getClassLabel: () => "2WD", getSessionGridEntries: () => [], getRemainingLabel: () => "", day, now: at("11:58") });
|
||||
assert.doesNotMatch(before, /class="board-live board-break"/, "no lunch banner before lunch");
|
||||
});
|
||||
|
||||
test("a heat already run between pending ones doesn't pull the rest of the day back to now", () => {
|
||||
const T = (h) => new Date(`2026-11-12T${h}:00`).getTime();
|
||||
const sessions = [
|
||||
{ id: "p", type: "practice", name: "practice 1", status: "ready", durationMin: 5 },
|
||||
{ id: "x", type: "practice", name: "other", status: "finished", durationMin: 5, startedAt: T("19:00"), endedAt: T("19:05") },
|
||||
{ id: "q1", type: "qualification", name: "Q1 H1", status: "ready", durationMin: 5 },
|
||||
{ id: "y", type: "qualification", name: "other q", status: "finished", durationMin: 5, startedAt: T("19:30"), endedAt: T("19:35") },
|
||||
{ id: "q2", type: "qualification", name: "Q2 H1", status: "ready", durationMin: 5 },
|
||||
];
|
||||
const rows = buildDaySchedule(sessions, { startAt: T("23:40"), gapMin: 3 }, T("23:39")).filter((row) => row.state === "upcoming");
|
||||
assert.deepEqual(rows.map((row) => row.start), [T("23:40"), T("23:48"), T("23:56")], "one after the other from the first start, not all at 23:39");
|
||||
});
|
||||
Reference in new issue
Block a user