lint + fix test

This commit is contained in:
Half-Shot
2025-09-15 10:38:37 +01:00
parent 425ce84653
commit 030c8f9038
4 changed files with 5 additions and 1 deletions

View File

@@ -55,6 +55,7 @@ beforeEach(() => {
(useAudioContext as MockedFunction<typeof useAudioContext>).mockReturnValue({ (useAudioContext as MockedFunction<typeof useAudioContext>).mockReturnValue({
playSound, playSound,
playSoundLooping: vitest.fn(), playSoundLooping: vitest.fn(),
soundDuration: {},
}); });
}); });

View File

@@ -99,6 +99,7 @@ beforeEach(() => {
(useAudioContext as MockedFunction<typeof useAudioContext>).mockReturnValue({ (useAudioContext as MockedFunction<typeof useAudioContext>).mockReturnValue({
playSound, playSound,
playSoundLooping: vi.fn(), playSoundLooping: vi.fn(),
soundDuration: {},
}); });
// A trivial implementation of Active call to ensure we are testing GroupCallView exclusively here. // A trivial implementation of Active call to ensure we are testing GroupCallView exclusively here.
(ActiveCall as MockedFunction<typeof ActiveCall>).mockImplementation( (ActiveCall as MockedFunction<typeof ActiveCall>).mockImplementation(
@@ -212,6 +213,7 @@ test("GroupCallView plays a leave sound synchronously in widget mode", async ()
(useAudioContext as MockedFunction<typeof useAudioContext>).mockReturnValue({ (useAudioContext as MockedFunction<typeof useAudioContext>).mockReturnValue({
playSound, playSound,
playSoundLooping: vitest.fn(), playSoundLooping: vitest.fn(),
soundDuration: {},
}); });
const { getByText, rtcSession } = createGroupCallView( const { getByText, rtcSession } = createGroupCallView(

View File

@@ -70,6 +70,7 @@ beforeEach(() => {
(useAudioContext as MockedFunction<typeof useAudioContext>).mockReturnValue({ (useAudioContext as MockedFunction<typeof useAudioContext>).mockReturnValue({
playSound, playSound,
playSoundLooping: vitest.fn(), playSoundLooping: vitest.fn(),
soundDuration: {},
}); });
}); });

View File

@@ -75,7 +75,7 @@ function playSoundLooping(
let lastSoundPromise: Promise<void>; let lastSoundPromise: Promise<void>;
let nextSoundPromise: Promise<void>; let nextSoundPromise: Promise<void>;
let ac: AbortController | undefined; let ac: AbortController | undefined;
void (async () => { void (async (): Promise<void> => {
ac = new AbortController(); ac = new AbortController();
// Play a sound immediately // Play a sound immediately
lastSoundPromise = Promise.resolve(); lastSoundPromise = Promise.resolve();