fix(race-setup): ask before deleting a race or a session (1.54.1)

This commit is contained in:
larssand committed 2026-11-02 08:48:37 +01:00
1 parent d0248b1960
commit 8b625c3d64
7 files changed
+27 -3

No files matched your search

+10
View File
@@ -101,6 +101,16 @@ export async function runDayScheduleSmoke({ evaluate, navigate, savedState, wait
await evaluate(`document.getElementById("dayToggleDone").click()`);
await waitFor(async () => (await rowIds()).includes("ds_4wd_q1"), "and shown again on request");
console.log("PASS today's schedule folds run heats into one line and marks the next heat");
// Deleting a race always asks first (the harness answers OK).
await patchState({ events: [...(await savedState()).events, { id: "ds_delete_me", name: "DS Delete Me", date: today, mode: "race", raceConfig: {} }] });
await navigate("race_setup", "raceWizardStepForm");
const asked = dialogs.length;
await evaluate(`document.getElementById("event-delete-ds_delete_me").click()`);
await waitFor(async () => !(await savedState()).events.some((event) => event.id === "ds_delete_me"), "the race is deleted after OK");
assert.equal(dialogs.length, asked + 1, "a question was asked");
assert.match(dialogs.at(-1).message, /DS Delete Me/);
console.log("PASS deleting a race asks first");
} finally {
const current = await savedState();
await patchState({