Skip to content

Commit 8f17614

Browse files
committed
Fix tests
1 parent 7d01179 commit 8f17614

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

src/room/GroupCallView.test.tsx

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { GroupCallView } from "./GroupCallView";
3838
import { type WidgetHelpers } from "../widget";
3939
import { LazyEventEmitter } from "../LazyEventEmitter";
4040
import { MatrixRTCFocusMissingError } from "../utils/errors";
41+
import { ProcessorProvider } from "../livekit/TrackProcessorContext";
4142

4243
vi.mock("../soundUtils");
4344
vi.mock("../useAudioContext");
@@ -46,6 +47,13 @@ vi.mock("react-use-measure", () => ({
4647
default: (): [() => void, object] => [(): void => {}, {}],
4748
}));
4849

50+
vi.hoisted(
51+
() =>
52+
(global.ImageData = class MockImageData {
53+
public data: number[] = [];
54+
} as unknown as typeof ImageData),
55+
);
56+
4957
const enterRTCSession = vi.hoisted(() => vi.fn(async () => Promise.resolve()));
5058
const leaveRTCSession = vi.hoisted(() =>
5159
vi.fn(
@@ -137,18 +145,20 @@ function createGroupCallView(
137145
const { getByText } = render(
138146
<BrowserRouter>
139147
<TooltipProvider>
140-
<GroupCallView
141-
client={client}
142-
isPasswordlessUser={false}
143-
confineToRoom={false}
144-
preload={false}
145-
skipLobby={false}
146-
hideHeader={true}
147-
rtcSession={rtcSession as unknown as MatrixRTCSession}
148-
isJoined={joined}
149-
muteStates={muteState}
150-
widget={widget}
151-
/>
148+
<ProcessorProvider>
149+
<GroupCallView
150+
client={client}
151+
isPasswordlessUser={false}
152+
confineToRoom={false}
153+
preload={false}
154+
skipLobby={false}
155+
hideHeader={true}
156+
rtcSession={rtcSession as unknown as MatrixRTCSession}
157+
isJoined={joined}
158+
muteStates={muteState}
159+
widget={widget}
160+
/>
161+
</ProcessorProvider>
152162
</TooltipProvider>
153163
</BrowserRouter>,
154164
);

0 commit comments

Comments
 (0)