feat(race): autopilot waits for qualifying from practice; qualifying start time per class (1.89.51)
This commit is contained in:
1 parent
57e081e291
commit
fbc4246a60
12 files changed
+114
-10
No files matched your search
@@ -222,3 +222,24 @@ test("marshals: the drivers of the heat before (or after), never someone driving
|
||||
assert.deepEqual(names(assignMarshals(rows, "off", of)), ["", "", ""]);
|
||||
assert.equal(normalizeRaceDays([{ date: "2026-11-08", marshalRule: "bogus" }])[0].marshalRule, "off");
|
||||
});
|
||||
|
||||
test("a class's qualifying start time holds its qualifiers until then; practice and other days are not moved", () => {
|
||||
const now = new Date("2026-11-08T10:00:00").getTime();
|
||||
const qualAt = new Date("2026-11-08T11:30:00").getTime();
|
||||
const day = { date: "2026-11-08", gapMin: 2, qualStartAt: { e2: qualAt } };
|
||||
const daySessions = [s("p", "e2", "practice", "practice 1"), s("q1", "e2", "qualification", "Q1 H1"), s("q2", "e2", "qualification", "Q1 H2")];
|
||||
const rows = buildDaySchedule(daySessions, day, now);
|
||||
assert.equal(rows[0].start, now, "practice now");
|
||||
assert.equal(rows[1].start, qualAt, "first qualifier at the chosen time");
|
||||
assert.equal(rows[2].start, qualAt + 5 * 60000 + 2 * 60000, "the next one after it as usual");
|
||||
assert.equal(normalizeRaceDays([day])[0].qualStartAt.e2, qualAt);
|
||||
});
|
||||
|
||||
test("autopilot waits for 'Generate qualifying from practice' when the next heat is a preliminary qualifier", () => {
|
||||
const rows = [{ state: "done", session: s("p", "e2", "practice", "practice 1") }, { state: "upcoming", start: 0, session: s("q1", "e2", "qualification", "Q1 H1") }];
|
||||
const waiting = getAutopilotAction(rows, { day: {}, now: 10, seedPending: { e2: "2WD" } });
|
||||
assert.equal(waiting.type, "wait");
|
||||
assert.equal(waiting.reason, "seed");
|
||||
assert.deepEqual(waiting.classes, ["2WD"]);
|
||||
assert.equal(getAutopilotAction(rows, { day: {}, now: 10, seedPending: {} }).type, "start", "built from practice: starts as before");
|
||||
});
|
||||
Reference in new issue
Block a user