fix(series): clearer step layout, sorted class list and autosave

The series page is split into numbered steps; classes are a sorted list
with the tick on the left and All/None, new series start with none, and
every change is saved straight away so ticks are no longer lost. Also
gives primary/danger buttons white text in the light theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
larssand
2026-10-11 18:28:05 +02:00
parent ec200aef2b
commit 581ec2c781
12 changed files with 172 additions and 46 deletions

View File

@@ -27,6 +27,15 @@ export async function runSeriesSmoke({ evaluate, navigate, savedState, waitFor,
await navigate("series", "seriesNew");
await evaluate(`document.getElementById("seriesNew").click()`);
await waitFor(async () => Boolean(await evaluate(`document.getElementById("seriesForm")`)), "series form");
assert.equal(await evaluate(`document.querySelectorAll('#seriesForm input[name="classIds"]:checked').length`), 0, "a new series starts with no class ticked");
// Sorted by name, one row each.
const classNames = await evaluate(`[...document.querySelectorAll(".series-class-row span")].map((node) => node.textContent.trim())`);
assert.deepEqual(classNames.filter((name) => name.startsWith("SR ")), ["SR 2WD", "SR 4WD"]);
// A tick is saved straight away - no Save button.
await evaluate(`(() => { const box = document.querySelector('#seriesForm input[name="classIds"][value="sr_4wd"]'); box.checked = true; box.dispatchEvent(new Event("change", { bubbles: true })); })()`);
await waitFor(async () => ((await savedState()).series || []).some((series) => series.classIds.includes("sr_4wd")), "class tick saved immediately");
await waitFor(async () => (await evaluate(`document.querySelector('.series-class-row input[value="sr_4wd"]')?.closest("label").classList.contains("is-selected")`)) === true, "the ticked class is highlighted");
console.log("PASS series classes are sorted, start unticked and are saved as soon as they are ticked");
await evaluate(`(() => {
const form = document.getElementById("seriesForm");
form.elements.name.value = "SR Winter Cup";