test(audio): passing beep plays for every car with no lock
This commit is contained in:
1 parent
c07a652f8e
commit
119619d6ff
1 file changed
+12
@@ -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);
|
||||
});
|
||||
Reference in new issue
Block a user