feat(training): search, class filter and grouping in the club practice overview (1.89.18)
This commit is contained in:
1 parent
f8080ffaeb
commit
eefef11aaa
11 files changed
+129
-13
No files matched your search
@@ -58,6 +58,18 @@ export async function runTrainingSourceSmoke({ evaluate, navigate, savedState, w
|
||||
assert.equal(row[1], "🏁 TS Winter #3 TS 2WD · Kval 2 · TS Winter Cup", "race, session and series");
|
||||
assert.equal(row[2], "3");
|
||||
console.log("PASS training stats: practice by default; races shown per race session with 🏁 race · session · series, never as stints");
|
||||
|
||||
// The club table at the bottom of the overview: search and only drivers who trained.
|
||||
await evaluate(`location.href = ${JSON.stringify(`${base}/?view=training`)}`);
|
||||
await waitFor(async () => Boolean(await evaluate(`document.getElementById("trainingListSearch") && document.querySelector('tr[data-training-row][data-name="TS Driver"]')`)), "the club table with its toolbar");
|
||||
const visibleNames = () => evaluate(`[...document.querySelectorAll("tr[data-training-row]:not([hidden])")].map((tr) => tr.dataset.name)`);
|
||||
assert.ok((await visibleNames()).includes("TS Driver"), "a driver who trained is listed");
|
||||
await evaluate(`(() => { const input = document.getElementById("trainingListSearch"); input.value = "no such driver"; input.dispatchEvent(new Event("input")); })()`);
|
||||
assert.deepEqual(await visibleNames(), [], "the search hides the others");
|
||||
assert.equal(await evaluate(`document.querySelector("[data-training-list-none]").hidden`), false, "and says nothing matches");
|
||||
await evaluate(`(() => { const input = document.getElementById("trainingListSearch"); input.value = "ts dri"; input.dispatchEvent(new Event("input")); })()`);
|
||||
assert.deepEqual(await visibleNames(), ["TS Driver"]);
|
||||
console.log("PASS training stats: the club table has a search box that filters the drivers");
|
||||
} finally {
|
||||
const current = await savedState();
|
||||
const results = { ...current.resultsBySession };
|
||||
|
||||
Reference in new issue
Block a user