From 119619d6ff5931c52973da6bf758cf69f479cb16 Mon Sep 17 00:00:00 2001 From: larssand Date: Tue, 10 Nov 2026 22:20:27 +0100 Subject: [PATCH] test(audio): passing beep plays for every car with no lock --- tests/race_audio.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/race_audio.test.js b/tests/race_audio.test.js index 70ddec9..352f075 100644 --- a/tests/race_audio.test.js +++ b/tests/race_audio.test.js @@ -387,3 +387,15 @@ test("a quick lap time call is dropped while the voice is busy", async () => { assert.equal(await free.voiceDone, true); assert.deepEqual(spoken, ["busy", "18 flat"]); }); + +test("passing beep plays for every car, even five cars inside a second (only voice calls skip while busy)", async () => { + const played = []; + const engine = createRaceAudioEngine({ + getSettings: () => ({ enabled: true }), + fetchImpl: async () => ({ ok: true, json: async () => manifest }), + audioFactory: (src) => ({ play: () => { played.push(src); return Promise.resolve(); }, volume: 1 }), + }); + const calls = ["a", "b", "c", "d", "e", "a"].map((key) => engine.trigger("transponder_pass", { variant: key, scope: key })); + await Promise.all(calls.map((call) => call.effectDone)); + assert.equal(played.length, 6); +});