feat(training): Standard / Pro switch on the driver's page; purple day-best lap and stint consistency (1.87.0)
This commit is contained in:
1 parent
73e1c0ccf3
commit
0caf50254a
13 files changed
+204
-28
No files matched your search
@@ -42,12 +42,12 @@ export async function runTrainingSourceSmoke({ evaluate, navigate, savedState, w
|
||||
assert.equal(await evaluate(`document.getElementById("training-source").value`), "practice", "practice is the default");
|
||||
assert.equal(await evaluate(`Boolean(document.querySelector('[data-sort-id="training-stints-featured"]'))`), true, "stints for practice");
|
||||
assert.equal(await evaluate(`document.querySelectorAll(".training-race-origin").length`), 0, "no race laps mixed into practice");
|
||||
// The stint card folds out to every lap, with the best lap starred.
|
||||
// The stint card folds out to every lap; the day's fastest is purple.
|
||||
assert.equal(await evaluate(`document.querySelectorAll(".stint-laps-card").length`), 1, "one practice stint card");
|
||||
await evaluate(`document.querySelector(".stint-laps-card > summary").click()`);
|
||||
assert.equal(await evaluate(`document.querySelector(".stint-laps-card").open`), true, "the card opens");
|
||||
assert.deepEqual(await evaluate(`[...document.querySelectorAll(".stint-laps-card .stint-lap-time")].map((cell) => cell.textContent.trim())`), ["0:20.000", "0:20.000", "0:19.500", "0:19.500"]);
|
||||
assert.equal(await evaluate(`document.querySelectorAll(".stint-laps-card .stint-lap.is-best").length`), 2, "both 19.500 laps are best");
|
||||
assert.equal(await evaluate(`document.querySelectorAll(".stint-laps-card .stint-lap.is-day-best").length`), 2, "both 19.500 laps are the day's fastest (purple)");
|
||||
console.log("PASS training stats: a practice stint folds out to every lap time");
|
||||
|
||||
await evaluate(`(() => { const select = document.getElementById("training-source"); select.value = "race"; select.dispatchEvent(new Event("change")); })()`);
|
||||
|
||||
Reference in new issue
Block a user