feat(race-setup): group a race's sessions per step, fold run steps, rare actions in a menu (1.53.0)
This commit is contained in:
1 parent
b23410c190
commit
73e3d1ff75
12 files changed
+147
-25
No files matched your search
@@ -120,4 +120,11 @@ export async function runRaceSetupSmoke({ evaluate, navigate, fill, savedState,
|
||||
assert.ok(await evaluate(`[...document.querySelectorAll("[data-event-row]")].some((row) => row.hidden)`), "other races are filtered out");
|
||||
}
|
||||
console.log("PASS Race Setup groups races into today, upcoming and a folded Done list, with search");
|
||||
|
||||
// Manage: sessions grouped per step; print/export/delete live in the ⋯ menu.
|
||||
await click("event-manage-" + raceId);
|
||||
await waitFor(async () => Boolean(await evaluate(`document.querySelector('details[data-session-group="qual_1"]')`)), "qualifying round 1 is its own group");
|
||||
assert.equal(await evaluate(`document.querySelector('details[data-session-group="qual_1"]').open`), true, "a step not yet run is open");
|
||||
assert.equal(await evaluate(`Boolean(document.getElementById("session-delete-${q11.id}").closest("details.row-menu"))`), true, "delete is in the ⋯ menu");
|
||||
console.log("PASS Manage groups sessions per step with the rarer actions in a ⋯ menu");
|
||||
}
|
||||
@@ -30,3 +30,17 @@ test("progress says what is running or next and how many are run", () => {
|
||||
assert.deepEqual(getEventProgress(events[0], getSessions("a")), { total: 2, done: 1, live: "", next: "Q1 H2" });
|
||||
assert.equal(getEventProgress(events[3], getSessions("d")).live, "Q1 H1");
|
||||
});
|
||||
|
||||
test("a race's sessions are grouped per step, and a step with every heat run is done", async () => {
|
||||
const { groupSessionsBySteps } = await import("../src/race_list_logic.js");
|
||||
const groups = groupSessionsBySteps([
|
||||
s("p", "x", "Seeding", "finished", "practice"),
|
||||
s("q1", "x", "Q1 H1", "finished"), s("q2", "x", "Q1 H2", "finished"),
|
||||
s("q3", "x", "Q2 H1", "running"), s("q4", "x", "Q2 H2"),
|
||||
s("b", "x", "B Final 1", "ready", "final"), s("a", "x", "A Final 1", "ready", "final"),
|
||||
]);
|
||||
assert.deepEqual(groups.map((group) => [group.step.id, group.items.length, group.state]), [
|
||||
["practice", 1, "done"], ["qual_1", 2, "done"], ["qual_2", 2, "live"], ["final", 2, "pending"],
|
||||
]);
|
||||
assert.equal(groups[3].items[0].index, 5, "keeps each session's place in the whole list");
|
||||
});
|
||||
Reference in new issue
Block a user