feat(series): next-step button per round and Race Day next session (1.44.0)
This commit is contained in:
1 parent
dbda06d101
commit
71aa149a4d
12 files changed
+145
-10
No files matched your search
@@ -8,6 +8,17 @@ The application version is maintained in `package.json` and displayed in the adm
|
||||
|
||||
No changes recorded yet.
|
||||
|
||||
## 1.44.0 - 2026-10-31
|
||||
|
||||
### Added
|
||||
|
||||
- **Series: one button for the next step of each round.** Every round's row shows what comes next - "▶ Seeding practice", "Create qualifying", "▶ Run Q1 H2", "Create finals", "▶ Run B Final 1" - or what is running now. A run button makes that session the active one and opens Race Day, so only Start is left to press. The seeding practice can be skipped ("Skip - generate qualifying").
|
||||
- **Race Day: "Next: …" after a finished session.** One click selects the next heat or final of the same race.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Race Day's "Next" followed the wrong order for generated qualifying.** After Q1 H1 it showed Q2 H1 instead of Q1 H2. Sessions now run practice first, then qualifying round by round, then finals leg by leg with the lowest final first (C, B, A).
|
||||
|
||||
## 1.43.1 - 2026-10-31
|
||||
|
||||
### Fixed
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "rc-racecore",
|
||||
"version": "1.43.1",
|
||||
"version": "1.44.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "rc-racecore",
|
||||
"version": "1.43.1",
|
||||
"version": "1.44.0",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"better-sqlite3": "^12.11.1",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rc-racecore",
|
||||
"version": "1.43.1",
|
||||
"version": "1.44.0",
|
||||
"private": true,
|
||||
"description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence",
|
||||
"engines": {
|
||||
|
||||
+21
-2
@@ -9,7 +9,7 @@ import { recordTransponderSighting, buildWarmupCheck, createPrologue, getPrologu
|
||||
import { findTransponderConflict, getDriverProfileId } from "./driver_profile_logic.js";
|
||||
import { renderRaceDayView, refreshRaceDayWarmup, refreshRaceDayPrologueClock, updateRaceDayStartDisplay } from "./race_day_view.js";
|
||||
import { beginSession as beginSessionControl, finishSession as finishSessionControl, pauseSession as pauseSessionControl, resumeSession as resumeSessionControl } from "./session_control.js";
|
||||
import { normalizeSeries, buildSeriesStandings, getSeriesRoundStatus } from "./series_logic.js";
|
||||
import { normalizeSeries, buildSeriesStandings, getSeriesRoundStatus, getSeriesRoundNextStep } from "./series_logic.js";
|
||||
import { renderSeriesView } from "./series_view.js";
|
||||
import { RACE_AUDIO_EVENT_DEFINITIONS, createRaceAudioEngine, normalizeRaceAudioSettings, isSilencedDuringRace } from "./race_audio.js";
|
||||
|
||||
@@ -616,6 +616,7 @@ const getSeriesRounds = (series) => state.events
|
||||
classDrivers: state.drivers.filter((driver) => driver.classId === event.classId).sort(byDriverName),
|
||||
participantIds: getEventDrivers(event).map((driver) => driver.id),
|
||||
status: getSeriesRoundStatus(sessions),
|
||||
nextStep: getSeriesRoundNextStep(sessions),
|
||||
qualHeatCount: new Set(qualSessions.map((session) => String(session.name || "").split(" ").pop())).size,
|
||||
finalCount: sessions.filter((session) => session.type === "final").length,
|
||||
};
|
||||
@@ -687,6 +688,12 @@ const generateSeriesRoundFinals = (eventId) => {
|
||||
saveState();
|
||||
return created;
|
||||
};
|
||||
// The row's run button: make the session the active one and go to Race Day, where only
|
||||
// Start is left to press.
|
||||
const runSeriesSession = (sessionId) => {
|
||||
if (!selectOperationalSession(sessionId, { render: false })) return;
|
||||
navigateToView("race_day");
|
||||
};
|
||||
const openSeriesRound = (eventId) => {
|
||||
selectedEventEditId = eventId;
|
||||
navigateToView("race_setup");
|
||||
@@ -724,7 +731,7 @@ const exportSeriesPdf = async (series, tables) => {
|
||||
)),
|
||||
});
|
||||
};
|
||||
const renderSeries = () => renderSeriesView({ state, dom, t, escapeHtml, saveState, renderView, uid, getClassName, getSeriesStandings, createSeriesEvents, getRaceFormatPresets, exportSeriesPdf, printSeries, getSeriesRounds, deleteSeriesRaces, setSeriesRoundFormat, setSeriesRoundParticipants, copySeriesRoundParticipants, addDriverToSeriesRound, generateSeriesRoundQualifying, generateSeriesRoundFinals, openSeriesRound });
|
||||
const renderSeries = () => renderSeriesView({ state, dom, t, escapeHtml, saveState, renderView, uid, getClassName, getSeriesStandings, createSeriesEvents, getRaceFormatPresets, exportSeriesPdf, printSeries, getSeriesRounds, deleteSeriesRaces, runSeriesSession, setSeriesRoundFormat, setSeriesRoundParticipants, copySeriesRoundParticipants, addDriverToSeriesRound, generateSeriesRoundQualifying, generateSeriesRoundFinals, openSeriesRound });
|
||||
const renderArchive = () => renderResultsArchiveView({
|
||||
state, dom, t, escapeHtml, formatLap, formatRaceClock, renderTable,
|
||||
getClassName, getEventName, buildLeaderboard, getCompetitorPassings,
|
||||
@@ -910,6 +917,7 @@ const TRANSLATIONS = {
|
||||
"race_day.quick_race": "Skapa race",
|
||||
"race_day.pick_session": "Session",
|
||||
"race_day.show_all_sessions": "Visa alla sessioner",
|
||||
"race_day.go_next": "Nästa: {name}",
|
||||
"race_day.hidden_sessions": "({count} från andra dagar dolda)",
|
||||
"race_day.reset_session_hint": "Nollställer sessionens varv och resultat, t.ex. vid omstart. Pausa först om heatet körs.",
|
||||
"race_day.reset_session_confirm": "Nollställ alla varv och resultat i \"{name}\"?\n\nDet går inte att ångra.",
|
||||
@@ -1017,6 +1025,11 @@ const TRANSLATIONS = {
|
||||
"series.delete_races_confirm": "Ta också bort seriens {count} race från Race Setup, med heat och resultat?\n\nOK = ta bort racen\nAvbryt = behåll racen (t.ex. för resultatarkivet)",
|
||||
"series.created_rounds": "{count} race skapade. De finns i listan nedan och under Race Setup.",
|
||||
"series.created_none": "Inga nya race skapades: seriens klasser har redan race på de datumen.",
|
||||
"series.run_seeding": "Seedningsträning",
|
||||
"series.run_session": "Kör {name}",
|
||||
"series.show_live": "Pågår: {name}",
|
||||
"series.skip_seeding": "Hoppa över – generera kval",
|
||||
"series.run_hint": "Väljer sessionen och öppnar Race Day – där trycker du Starta.",
|
||||
"nav.race_setup": "Race Setup",
|
||||
"nav.race_setup_sub": "Open Practice, klubbrace och endurance",
|
||||
"nav.overlay": "Overlay",
|
||||
@@ -2769,6 +2782,7 @@ const TRANSLATIONS = {
|
||||
"race_day.quick_race": "Create race",
|
||||
"race_day.pick_session": "Session",
|
||||
"race_day.show_all_sessions": "Show all sessions",
|
||||
"race_day.go_next": "Next: {name}",
|
||||
"race_day.hidden_sessions": "({count} from other days hidden)",
|
||||
"race_day.reset_session_hint": "Clears the session's laps and results, e.g. for a restart. Pause first if the heat is running.",
|
||||
"race_day.reset_session_confirm": "Clear every lap and result in \"{name}\"?\n\nThis cannot be undone.",
|
||||
@@ -2876,6 +2890,11 @@ const TRANSLATIONS = {
|
||||
"series.delete_races_confirm": "Also delete the series' {count} races from Race Setup, with heats and results?\n\nOK = delete the races\nCancel = keep the races (e.g. for the results archive)",
|
||||
"series.created_rounds": "{count} races created. They are listed below and under Race Setup.",
|
||||
"series.created_none": "No new races were created: the series' classes already have races on those dates.",
|
||||
"series.run_seeding": "Seeding practice",
|
||||
"series.run_session": "Run {name}",
|
||||
"series.show_live": "Running: {name}",
|
||||
"series.skip_seeding": "Skip – generate qualifying",
|
||||
"series.run_hint": "Selects the session and opens Race Day - press Start there.",
|
||||
"nav.race_setup": "Race Setup",
|
||||
"nav.race_setup_sub": "Open Practice, club races and endurance",
|
||||
"nav.overlay": "Overlay",
|
||||
|
||||
@@ -752,6 +752,28 @@ export function generateQualifyingForRace(event, { buildPracticeStandings, getEv
|
||||
|
||||
|
||||
|
||||
// The order a race's sessions are run in: practice, then qualifying round by round (Q1 H1,
|
||||
// Q1 H2, Q2 H1 ... - generation stores them heat by heat), then finals leg by leg with the
|
||||
// lowest final first (C1, B1, A1, C2 ...). Anything else keeps the order it was created in.
|
||||
export function orderSessionsForRunning(sessions = []) {
|
||||
const key = (session, index) => {
|
||||
if (["practice", "free_practice", "open_practice"].includes(session.type)) return [0, 0, 0, index];
|
||||
if (session.type === "qualification") {
|
||||
const parsed = parseQualifyingHeatName(session.name);
|
||||
return parsed ? [1, parsed.round, parsed.heat, index] : [1, 0, 0, index];
|
||||
}
|
||||
if (session.type === "final") {
|
||||
const match = String(session.name || "").match(/^([A-Z])\b.*?(\d+)\s*$/);
|
||||
return match ? [2, Number(match[2]), -(match[1].charCodeAt(0)), index] : [2, 0, 0, index];
|
||||
}
|
||||
return [1, 0, 0, index];
|
||||
};
|
||||
return sessions
|
||||
.map((session, index) => ({ session, key: key(session, index) }))
|
||||
.sort((a, b) => a.key.reduce((diff, value, i) => diff || value - b.key[i], 0))
|
||||
.map((item) => item.session);
|
||||
}
|
||||
|
||||
// Generated qualifying sessions are named "Q<round> H<heat>" (see generateQualifyingForRace)
|
||||
// with no separate round/heat fields of their own - shared here so every place that needs
|
||||
// to know which round/heat a session belongs to parses the same way.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { orderSessionsForRunning } from "./event_race_logic.js";
|
||||
import { describeDecoderClockSkew } from "./decoder_clock_check.js";
|
||||
import { getLayoutLapWindowOverride } from "./track_layouts_logic.js";
|
||||
function unique(values) {
|
||||
@@ -42,7 +43,7 @@ export function buildRaceDayQueue(state) {
|
||||
return { current: null, next: null, afterNext: null, upcoming: [] };
|
||||
}
|
||||
|
||||
const eventSessions = sessions.filter((session) => session.eventId === current.eventId);
|
||||
const eventSessions = orderSessionsForRunning(sessions.filter((session) => session.eventId === current.eventId));
|
||||
const currentIndex = eventSessions.findIndex((session) => session.id === current.id);
|
||||
const upcoming = eventSessions
|
||||
.slice(Math.max(0, currentIndex + 1))
|
||||
|
||||
@@ -280,6 +280,7 @@ export function renderRaceDayView(deps) {
|
||||
${sessionChoices.hidden || showAllSessions ? `<label class="race-day-show-all"><input type="checkbox" id="raceDayShowAllSessions" ${showAllSessions ? "checked" : ""} /> ${escapeHtml(t("race_day.show_all_sessions"))}${sessionChoices.hidden ? ` <span class="hint">${escapeHtml(t("race_day.hidden_sessions", { count: sessionChoices.hidden }))}</span>` : ""}</label>` : ""}
|
||||
${session && !isSelected ? `<button id="raceDayActivate" class="btn" type="button">${t("race_day.activate")}</button>` : ""}
|
||||
<div class="race-day-actions">
|
||||
${session && ["finished", "stopped"].includes(session.status) && queue.next ? `<button id="raceDayNextSession" class="btn btn-go" type="button" data-race-day-select="${escapeHtml(queue.next.id)}">▶ ${escapeHtml(t("race_day.go_next", { name: queue.next.name }))}</button>` : ""}
|
||||
${usesPrologue
|
||||
? renderPrologueControls({ t, escapeHtml, getDefaultPrologueSec }, session, warmupForChecks, canStart)
|
||||
: isLiveSession ? "" : `<button id="raceDayStart" class="btn btn-go" type="button" ${canStart ? "" : "disabled"}>${t(isPracticeSession ? "race_day.start_practice" : "timing.start")}</button>`}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { orderSessionsForRunning } from "./event_race_logic.js";
|
||||
// Series / cup: a set of races (events) scored together. Each event is one class, so a series
|
||||
// with several classes gives one standings table per class. Pure functions - app.js feeds
|
||||
// each event's day result (finishing order, from finals or else qualifying).
|
||||
@@ -162,3 +163,23 @@ export function getSeriesRoundStatus(sessions = []) {
|
||||
if (finished(quals)) return "qual_done";
|
||||
return started(quals) ? "qual_running" : "qual_ready";
|
||||
}
|
||||
|
||||
// The one thing to do next in a round, for the button on its row: run the seeding practice,
|
||||
// make qualifying, run the next heat, make finals, run the next final. A session already
|
||||
// running is shown first.
|
||||
export function getSeriesRoundNextStep(sessions = []) {
|
||||
const ordered = orderSessionsForRunning(sessions);
|
||||
const live = ordered.find((session) => ["running", "paused"].includes(session.status));
|
||||
if (live) return { kind: "live", session: live };
|
||||
const ready = (type) => ordered.find((session) => session.type === type && session.status === "ready");
|
||||
const has = (type) => ordered.some((session) => session.type === type);
|
||||
if (!has("qualification")) {
|
||||
const practice = ready("practice");
|
||||
return practice ? { kind: "seeding", session: practice } : { kind: "make_qualifying" };
|
||||
}
|
||||
const heat = ready("qualification");
|
||||
if (heat) return { kind: "qualifying", session: heat };
|
||||
if (!has("final")) return { kind: "make_finals" };
|
||||
const final = ready("final");
|
||||
return final ? { kind: "final", session: final } : { kind: "done" };
|
||||
}
|
||||
+18
-4
@@ -84,6 +84,21 @@ function renderRoundParticipants(round, { t, escapeHtml }) {
|
||||
</div>`;
|
||||
}
|
||||
|
||||
// One button for what comes next in the round: seeding practice, make qualifying, the next
|
||||
// heat, make finals, the next final. "Run" selects the session and opens Race Day.
|
||||
function renderNextStep(round, { t, escapeHtml }) {
|
||||
const step = round.nextStep || {};
|
||||
const noDrivers = round.participantIds.length ? "" : "disabled";
|
||||
const run = (label, live = false) => `<button class="btn btn-go btn-mini" type="button" data-round-action="run" data-round-session="${escapeHtml(step.session.id)}" title="${escapeHtml(t("series.run_hint"))}" ${live ? "" : noDrivers}>${live ? "●" : "▶"} ${escapeHtml(label)}</button>`;
|
||||
const makeQualifying = (label, primary) => `<button class="btn ${primary ? "btn-primary" : ""} btn-mini" type="button" data-round-action="qualifying" ${noDrivers}>${escapeHtml(label)}</button>`;
|
||||
if (step.kind === "live") return run(t("series.show_live", { name: step.session.name }), true);
|
||||
if (step.kind === "seeding") return run(t("series.run_seeding")) + makeQualifying(t("series.skip_seeding"), false);
|
||||
if (step.kind === "make_qualifying") return makeQualifying(t("series.make_qualifying"), true);
|
||||
if (step.kind === "qualifying" || step.kind === "final") return run(t("series.run_session", { name: step.session.name }));
|
||||
if (step.kind === "make_finals") return `<button class="btn btn-primary btn-mini" type="button" data-round-action="finals">${t("series.make_finals")}</button>`;
|
||||
return "";
|
||||
}
|
||||
|
||||
function renderRoundsTable(rounds, { t, escapeHtml }) {
|
||||
if (!rounds.length) return `<p class="hint">${t("series.no_rounds")}</p>`;
|
||||
const number = (round, name, value, min) => `<input class="series-round-number" type="number" min="${min}" name="${name}" value="${value}" ${round.status === "not_started" ? "" : "disabled"} />`;
|
||||
@@ -92,9 +107,7 @@ function renderRoundsTable(rounds, { t, escapeHtml }) {
|
||||
<thead><tr><th>${t("series.col_date")}</th><th>${t("series.col_race")}</th><th>${t("series.col_drivers")}</th><th title="${escapeHtml(t("series.col_qual_hint"))}">${t("series.col_qual_short")}</th><th>${t("series.col_finals")}</th><th>${t("series.col_per_heat")}</th><th>${t("series.col_status")}</th><th></th></tr></thead>
|
||||
<tbody>${rounds.map((round) => {
|
||||
const config = round.event.raceConfig || {};
|
||||
const action = round.status === "not_started"
|
||||
? `<button class="btn btn-primary btn-mini" type="button" data-round-action="qualifying" ${round.participantIds.length ? "" : "disabled"}>${t("series.make_qualifying")}</button>`
|
||||
: round.status === "qual_done" ? `<button class="btn btn-primary btn-mini" type="button" data-round-action="finals">${t("series.make_finals")}</button>` : "";
|
||||
const action = renderNextStep(round, { t, escapeHtml });
|
||||
return `
|
||||
<tr data-round="${escapeHtml(round.event.id)}" class="${expandedRoundId === round.event.id ? "is-expanded" : ""}">
|
||||
<td>${escapeHtml(round.event.date || t("series.no_date"))}</td>
|
||||
@@ -143,7 +156,7 @@ function renderStandingsTable(table, { t, escapeHtml }) {
|
||||
export function renderSeriesView(deps) {
|
||||
const {
|
||||
state, dom, t, escapeHtml, saveState, renderView, uid, getClassName, getSeriesStandings, createSeriesEvents, getRaceFormatPresets, exportSeriesPdf, printSeries,
|
||||
getSeriesRounds, deleteSeriesRaces, setSeriesRoundFormat, setSeriesRoundParticipants, copySeriesRoundParticipants, addDriverToSeriesRound, generateSeriesRoundQualifying, generateSeriesRoundFinals, openSeriesRound,
|
||||
getSeriesRounds, deleteSeriesRaces, runSeriesSession, setSeriesRoundFormat, setSeriesRoundParticipants, copySeriesRoundParticipants, addDriverToSeriesRound, generateSeriesRoundQualifying, generateSeriesRoundFinals, openSeriesRound,
|
||||
} = deps;
|
||||
const list = state.series || [];
|
||||
if (!list.some((item) => item.id === selectedSeriesId)) selectedSeriesId = list[0]?.id || "";
|
||||
@@ -292,6 +305,7 @@ export function renderSeriesView(deps) {
|
||||
const action = button.dataset.roundAction;
|
||||
if (action === "toggle") expandedRoundId = expandedRoundId === eventId ? "" : eventId;
|
||||
if (action === "open") { openSeriesRound(eventId); return; }
|
||||
if (action === "run") { runSeriesSession(button.dataset.roundSession); return; }
|
||||
if (action === "qualifying" && !generateSeriesRoundQualifying(eventId)) window.alert(t("series.no_participants"));
|
||||
if (action === "finals") generateSeriesRoundFinals(eventId);
|
||||
if (action === "remove") {
|
||||
|
||||
@@ -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"));`);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import "./auth.test.js";
|
||||
import "./series_next_step.test.js";
|
||||
import "./race_day_sessions.test.js";
|
||||
import "./overlay_leaderboard.test.js";
|
||||
import "./decoder_clock_check.test.js";
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { orderSessionsForRunning } from "../src/event_race_logic.js";
|
||||
import { getSeriesRoundNextStep } from "../src/series_logic.js";
|
||||
import { buildRaceDayQueue } from "../src/race_day_logic.js";
|
||||
|
||||
const s = (name, type, status = "ready") => ({ id: name, name, type, status, eventId: "e" });
|
||||
|
||||
test("sessions run practice, then qualifying round by round, then finals leg by leg from the lowest", () => {
|
||||
const sessions = [
|
||||
s("A Final 1", "final"), s("A Final 2", "final"), s("B Final 1", "final"), s("B Final 2", "final"),
|
||||
s("Q1 H1", "qualification"), s("Q2 H1", "qualification"), s("Q1 H2", "qualification"), s("Q2 H2", "qualification"),
|
||||
s("Seeding practice", "practice"),
|
||||
];
|
||||
assert.deepEqual(orderSessionsForRunning(sessions).map((item) => item.name),
|
||||
["Seeding practice", "Q1 H1", "Q1 H2", "Q2 H1", "Q2 H2", "B Final 1", "A Final 1", "B Final 2", "A Final 2"]);
|
||||
});
|
||||
|
||||
test("Race Day's next heat follows the running order", () => {
|
||||
const sessions = [s("Q1 H1", "qualification", "finished"), s("Q2 H1", "qualification"), s("Q1 H2", "qualification")];
|
||||
assert.equal(buildRaceDayQueue({ sessions, activeSessionId: "Q1 H1" }).next.name, "Q1 H2");
|
||||
});
|
||||
|
||||
test("a series round's next step walks seeding -> qualifying -> heats -> finals -> done", () => {
|
||||
assert.deepEqual(getSeriesRoundNextStep([s("Seeding", "practice")]), { kind: "seeding", session: s("Seeding", "practice") });
|
||||
assert.deepEqual(getSeriesRoundNextStep([s("Seeding", "practice", "finished")]), { kind: "make_qualifying" });
|
||||
assert.equal(getSeriesRoundNextStep([s("Seeding", "practice", "running")]).kind, "live");
|
||||
const quals = [s("Q2 H1", "qualification"), s("Q1 H1", "qualification", "finished"), s("Q1 H2", "qualification")];
|
||||
assert.equal(getSeriesRoundNextStep([s("Seeding", "practice"), ...quals]).session.name, "Q1 H2", "an unrun seeding practice is skipped once qualifying exists");
|
||||
assert.deepEqual(getSeriesRoundNextStep([s("Q1 H1", "qualification", "finished")]), { kind: "make_finals" });
|
||||
assert.equal(getSeriesRoundNextStep([s("Q1 H1", "qualification", "finished"), s("A Final 1", "final"), s("B Final 1", "final")]).session.name, "B Final 1");
|
||||
assert.deepEqual(getSeriesRoundNextStep([s("Q1 H1", "qualification", "finished"), s("A Final 1", "final", "finished")]), { kind: "done" });
|
||||
});
|
||||
Reference in new issue
Block a user