From 8e67cfe3c46e13e40b46137499dc8bee31b666ac Mon Sep 17 00:00:00 2001 From: David Langley Date: Wed, 27 Aug 2025 22:03:27 +0100 Subject: [PATCH] Revert "Only mock the call object for tests that expect it." This reverts commit 043d812b1defe75eb7d9c56546317f176b4ba34e. --- .../components/views/rooms/RoomHeader/RoomHeader-test.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit-tests/components/views/rooms/RoomHeader/RoomHeader-test.tsx b/test/unit-tests/components/views/rooms/RoomHeader/RoomHeader-test.tsx index 7c7cb375f9..0871d72871 100644 --- a/test/unit-tests/components/views/rooms/RoomHeader/RoomHeader-test.tsx +++ b/test/unit-tests/components/views/rooms/RoomHeader/RoomHeader-test.tsx @@ -96,9 +96,9 @@ describe("RoomHeader", () => { setCardSpy = jest.spyOn(RightPanelStore.instance, "setCard"); jest.spyOn(ShieldUtils, "shieldStatusForRoom").mockResolvedValue(ShieldUtils.E2EStatus.Normal); - // Mock CallStore.instance.getCall to return null by default - // Individual tests can override this when they need a specific Call object - jest.spyOn(CallStore.instance, "getCall").mockReturnValue(null); + // Mock CallStore.instance.getCall to return a Call object with stable participants + // This prevents React dependency errors without disrupting hook execution order + jest.spyOn(CallStore.instance, "getCall").mockReturnValue(createMockCall()); }); afterEach(() => {