feat(race): race actions as steps of the day; qualifying heats marked preliminary until built from practice (1.89.47)

This commit is contained in:
larssand committed 2026-11-16 22:08:24 +01:00
1 parent 74a2e9ba47
commit 047490d00b
10 files changed
+116 -24

No files matched your search

+12
View File
@@ -44,3 +44,15 @@ test("practice heats: a new participant joins the smallest heat of every round",
assert.deepEqual(withNew, ["träning 1 H2", "träning 2 H2"]);
assert.deepEqual(parsePracticeHeatName("practice 3 H2"), { round: 3, heat: 2 });
});
test("qualifying seed notice: preliminary until practice is run, then a reminder until built from it", async () => {
const { getQualifyingSeedNotice } = await import("../src/event_race_logic.js");
const q = { type: "qualification", generated: true, status: "ready" };
const ev = { raceConfig: {} };
assert.equal(getQualifyingSeedNotice(ev, [{ type: "practice", status: "ready" }, q]), "preliminary");
const ran = { type: "practice", status: "finished", endedAt: 1000 };
assert.equal(getQualifyingSeedNotice(ev, [ran, q]), "ready");
assert.equal(getQualifyingSeedNotice({ raceConfig: { qualFromPracticeAt: 2000 } }, [ran, q]), null);
assert.equal(getQualifyingSeedNotice(ev, [ran, { ...q, status: "finished", startedAt: 5 }]), null, "qualifying started");
assert.equal(getQualifyingSeedNotice(ev, [q]), null, "no practice");
});