mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-30 19:39:22 +00:00
lint + fix test
This commit is contained in:
@@ -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: {},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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: {},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user