fix(race): finish the lap you are on, one clock owner, edits survive refresh, participants editable (1.59.0)
This commit is contained in:
1 parent
afb8829b16
commit
db6a9f19e4
16 files changed
+313
-39
No files matched your search
@@ -58,6 +58,16 @@ export async function runRaceSetupSmoke({ evaluate, navigate, fill, savedState,
|
||||
assert.ok(quals.length >= 2 && quals.every((session) => /^Q[12] H\d+$/.test(session.name) && session.generated), `qualifying heats per round: ${quals.map((session) => session.name)}`);
|
||||
assert.equal(club.raceConfig.qualifyingRounds, 2);
|
||||
console.log("PASS wizard builds qualifying as Q<round> H<heat> heats");
|
||||
// A driver left out can be ticked again, and the heats not run yet follow the list.
|
||||
await click("event-manage-" + club.id);
|
||||
await waitFor(async () => (await evaluate('document.querySelectorAll(".race-participant").length')) > 0, "participant list");
|
||||
const first = await evaluate('document.querySelector(".race-participant:checked").value');
|
||||
await evaluate(`document.querySelector('.race-participant[value="${first}"]').click()`);
|
||||
await waitFor(async () => !(await savedState()).sessions.some((session) => session.eventId === club.id && session.type === "qualification" && session.driverIds.includes(first)), "unticked driver leaves the heats");
|
||||
await waitFor(async () => Boolean(await evaluate(`Boolean(document.querySelector('.race-participant[value="${first}"]:not(:checked)'))`)), "unticked driver still listed");
|
||||
await evaluate(`document.querySelector('.race-participant[value="${first}"]').click()`);
|
||||
await waitFor(async () => (await savedState()).sessions.some((session) => session.eventId === club.id && session.type === "qualification" && session.driverIds.includes(first)), "ticked again: back in a heat");
|
||||
console.log("PASS race participants can be changed after creation and the heats follow");
|
||||
}
|
||||
await navigate("race_setup", "raceWizardStepForm");
|
||||
await editEvent(race, "race_setup", "raceWizardStepForm");
|
||||
|
||||
Reference in new issue
Block a user