From 692a55c84cce0ae1de0a5597f81cdeffeca43e91 Mon Sep 17 00:00:00 2001 From: Timo K Date: Tue, 2 Jun 2026 14:06:28 +0200 Subject: [PATCH] fix race --- src/room/GroupCallView.test.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/room/GroupCallView.test.tsx b/src/room/GroupCallView.test.tsx index 1576fbdc..337c489a 100644 --- a/src/room/GroupCallView.test.tsx +++ b/src/room/GroupCallView.test.tsx @@ -272,7 +272,7 @@ test("Should close widget when all other left and have time to play a sound", as lazyActions: new LazyEventEmitter(), }; const resolvePlaySound = Promise.withResolvers(); - playSound = vi.fn().mockReturnValue(resolvePlaySound); + playSound = vi.fn().mockReturnValue(resolvePlaySound.promise); (useAudioContext as MockedFunction).mockReturnValue({ playSound, playSoundLooping: vitest.fn(), @@ -285,7 +285,6 @@ test("Should close widget when all other left and have time to play a sound", as await flushPromises(); expect(widgetClosedCalled).toBeFalsy(); resolvePlaySound.resolve(); - await flushPromises(); // Expect the leave sound to be played but silent (volumeOverwrite = 0) // The allOthersLeft effect should already play a leave sound for the last user in the call.