fix(race): a changed qualifying ranking also re-ranks qualifiers already run (1.89.13)

This commit is contained in:
larssand committed 2026-11-12 21:52:11 +01:00
1 parent 4a1460b480
commit 1b968bc275
7 files changed
+28 -6

No files matched your search

+12
View File
@@ -58,3 +58,15 @@ test("the background refresh keeps the objects a form already holds", () => {
held.durationMin = 4;
assert.equal(next[0].durationMin, 4, "so an edit through the held reference is not lost");
});
test("a ranking fixed afterwards (best 3 laps -> laps and time) re-ranks qualifiers already run; their time stays", () => {
const sessions = [
{ id: "q1", type: "qualification", status: "finished", startedAt: 1, durationMin: 5, seedBestLapCount: 3, seedMethod: "consecutive" },
{ id: "q2", type: "qualification", status: "ready", durationMin: 5, seedBestLapCount: 3, seedMethod: "consecutive" },
];
applyFormatToPendingSessions(sessions, { qualSeedLapCount: 3, qualDurationMin: 5 }, { qualSeedLapCount: 0, qualDurationMin: 4 });
assert.equal(sessions[0].seedBestLapCount, 0, "the finished qualifier follows the new ranking");
assert.equal(sessions[0].durationMin, 5, "but keeps the time it was run with");
assert.equal(sessions[1].seedBestLapCount, 0);
assert.equal(sessions[1].durationMin, 4);
});