feat(series): seeding practice in groups split on the series standings (1.45.0)

This commit is contained in:
larssand committed 2026-10-31 22:52:18 +01:00
1 parent 80e0c5308a
commit e7eaa0561e
11 files changed
+112 -21

No files matched your search

+11 -4
View File
@@ -90,11 +90,18 @@ export async function runSeriesSmoke({ evaluate, navigate, savedState, waitFor,
await waitFor(async () => JSON.stringify([...(await savedState()).events.find((item) => item.id === roundTwo.id).raceConfig.driverIds].sort()) === JSON.stringify([...roundOneIds].sort()), "round 2 copied from round 1");
// The row's next step is the seeding practice: one click selects it and opens Race Day.
assert.equal(await inRound(roundOne.id, `return row.querySelector('[data-round-action="run"]')?.textContent.trim();`), "▶ Seeding practice");
await inRound(roundOne.id, `row.querySelector('[data-round-action="run"]').click();`);
// Max 2 per seeding group, 3 drivers today: two groups (2 + 1), split when the button is pressed.
await inRound(roundOne.id, `const input = row.querySelector('input[name="seedGroupSize"]'); input.value = "2"; input.dispatchEvent(new Event("change"));`);
await waitFor(async () => (await savedState()).events.find((item) => item.id === roundOne.id).raceConfig.seedGroupSize === 2, "seed group size saved");
await waitFor(async () => (await inRound(roundOne.id, `return row.querySelector('[data-round-action="seeding"]')?.textContent.trim();`)) === "▶ Seeding practice (2 groups)", "button says how many groups");
await inRound(roundOne.id, `row.querySelector('[data-round-action="seeding"]').click();`);
await waitFor(async () => (await evaluate(`new URL(location.href).searchParams.get("view")`)) === "race_day", "Race Day opened");
const practiceId = (await savedState()).sessions.find((session) => session.eventId === roundOne.id && session.type === "practice").id;
await waitFor(async () => (await savedState()).activeSessionId === practiceId, "seeding practice is the active session");
const seedingGroups = async () => (await savedState()).sessions.filter((session) => session.eventId === roundOne.id && session.type === "practice");
await waitFor(async () => (await seedingGroups()).length === 2, "seeding split into two groups");
const groups = await seedingGroups();
assert.deepEqual(groups.map((session) => [session.name, session.driverIds.length]), [["Seeding practice 1", 1], ["Seeding practice 2", 2]], "fastest group last: the 2 at the top of the order run second");
const practiceId = groups[0].id;
await waitFor(async () => (await savedState()).activeSessionId === practiceId, "first seeding group is the active session");
assert.ok(await evaluate(`Boolean(document.getElementById("raceDayStart"))`), "only Start is left to press");
await navigate("series", "seriesNew");
await evaluate(`document.querySelector('[data-series-select="${saved.id}"]')?.click()`);