feat(series): next-step button per round and Race Day next session (1.44.0)

This commit is contained in:
larssand committed 2026-10-31 09:03:34 +01:00
1 parent dbda06d101
commit 71aa149a4d
12 files changed
+145 -10

No files matched your search

+12
View File
@@ -89,6 +89,18 @@ export async function runSeriesSmoke({ evaluate, navigate, savedState, waitFor,
await evaluate(`document.querySelector('[data-round-participants="${roundTwo.id}"] [data-round-action="copy"]').click()`);
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();`);
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");
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()`);
await waitFor(async () => Boolean(await evaluate(`document.querySelector('tr[data-round="${roundOne.id}"]')`)), "back on the series");
console.log("PASS a round's next step: seeding practice is one click from Race Day");
// Round 1 gets three qualifying rounds (round 2 keeps two). Three drivers with max two per
// heat give two heats - of two and one - in each round.
await inRound(roundOne.id, `const input = row.querySelector('input[name="qualifyingRounds"]'); input.value = "3"; input.dispatchEvent(new Event("change"));`);