From 030c8f9038f5a5e1507b93346e19efd05fa2de80 Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Mon, 15 Sep 2025 10:38:37 +0100 Subject: [PATCH] lint + fix test --- src/room/CallEventAudioRenderer.test.tsx | 1 + src/room/GroupCallView.test.tsx | 2 ++ src/room/ReactionAudioRenderer.test.tsx | 1 + src/useAudioContext.tsx | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/room/CallEventAudioRenderer.test.tsx b/src/room/CallEventAudioRenderer.test.tsx index 4ba24a5e..40b79da4 100644 --- a/src/room/CallEventAudioRenderer.test.tsx +++ b/src/room/CallEventAudioRenderer.test.tsx @@ -55,6 +55,7 @@ beforeEach(() => { (useAudioContext as MockedFunction).mockReturnValue({ playSound, playSoundLooping: vitest.fn(), + soundDuration: {}, }); }); diff --git a/src/room/GroupCallView.test.tsx b/src/room/GroupCallView.test.tsx index 9bc0343b..15ac010e 100644 --- a/src/room/GroupCallView.test.tsx +++ b/src/room/GroupCallView.test.tsx @@ -99,6 +99,7 @@ beforeEach(() => { (useAudioContext as MockedFunction).mockReturnValue({ playSound, playSoundLooping: vi.fn(), + soundDuration: {}, }); // A trivial implementation of Active call to ensure we are testing GroupCallView exclusively here. (ActiveCall as MockedFunction).mockImplementation( @@ -212,6 +213,7 @@ test("GroupCallView plays a leave sound synchronously in widget mode", async () (useAudioContext as MockedFunction).mockReturnValue({ playSound, playSoundLooping: vitest.fn(), + soundDuration: {}, }); const { getByText, rtcSession } = createGroupCallView( diff --git a/src/room/ReactionAudioRenderer.test.tsx b/src/room/ReactionAudioRenderer.test.tsx index 1d963491..f301832e 100644 --- a/src/room/ReactionAudioRenderer.test.tsx +++ b/src/room/ReactionAudioRenderer.test.tsx @@ -70,6 +70,7 @@ beforeEach(() => { (useAudioContext as MockedFunction).mockReturnValue({ playSound, playSoundLooping: vitest.fn(), + soundDuration: {}, }); }); diff --git a/src/useAudioContext.tsx b/src/useAudioContext.tsx index 3e1da48c..59334dda 100644 --- a/src/useAudioContext.tsx +++ b/src/useAudioContext.tsx @@ -75,7 +75,7 @@ function playSoundLooping( let lastSoundPromise: Promise; let nextSoundPromise: Promise; let ac: AbortController | undefined; - void (async () => { + void (async (): Promise => { ac = new AbortController(); // Play a sound immediately lastSoundPromise = Promise.resolve();