fix live leaderbord details
This commit is contained in:
@@ -59,7 +59,7 @@ function createHarness() {
|
||||
|
||||
test("split decoder records intermediate time without changing main lap state", () => {
|
||||
const harness = createHarness();
|
||||
harness.passing(17_000, "main");
|
||||
assert.equal(harness.passing(17_000, "main"), true);
|
||||
const result = harness.state.resultsBySession.session_1;
|
||||
const entry = result.competitors.team_team_1;
|
||||
assert.equal(entry.laps, 1);
|
||||
@@ -150,3 +150,13 @@ test("connect decoder opens one websocket per enabled role", () => {
|
||||
globalThis.WebSocket = OriginalWebSocket;
|
||||
}
|
||||
});
|
||||
|
||||
test("non-passing decoder messages do not persist race state", () => {
|
||||
const harness = createHarness();
|
||||
const changed = processDecoderMessageHelper({ msg: "STATUS", decoder: "online" }, {
|
||||
state: harness.state,
|
||||
getActiveSession: () => harness.session,
|
||||
});
|
||||
assert.equal(Boolean(changed), false);
|
||||
assert.equal(harness.getSaveCount(), 0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user