diff --git a/src/button/ReactionToggleButton.test.tsx b/src/button/ReactionToggleButton.test.tsx index a1498304..ec5f5f2e 100644 --- a/src/button/ReactionToggleButton.test.tsx +++ b/src/button/ReactionToggleButton.test.tsx @@ -18,6 +18,7 @@ import { } from "../utils/testReactions"; import { ReactionToggleButton } from "./ReactionToggleButton"; import { ElementCallReactionEventType } from "../reactions"; +import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc"; const memberUserIdAlice = "@alice:example.org"; const memberEventAlice = "$membership-alice:example.org"; @@ -29,7 +30,7 @@ const membership: Record = { function TestComponent({ rtcSession, }: { - rtcSession: MockRTCSession; + rtcSession: MatrixRTCSession; }): ReactNode { return ( @@ -45,7 +46,7 @@ test("Can open menu", async () => { const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); const { getByLabelText, container } = render( - , + , ); await user.click(getByLabelText("common.reactions")); expect(container).toMatchSnapshot(); @@ -56,7 +57,7 @@ test("Can raise hand", async () => { const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); const { getByLabelText, container } = render( - , + , ); await user.click(getByLabelText("common.reactions")); await user.click(getByLabelText("action.raise_hand")); @@ -81,7 +82,7 @@ test("Can lower hand", async () => { const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); const { getByLabelText, container } = render( - , + , ); const reactionEvent = room.testSendHandRaise(memberEventAlice, membership); await user.click(getByLabelText("common.reactions")); @@ -95,7 +96,7 @@ test("Can react with emoji", async () => { const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); const { getByLabelText, getByText } = render( - , + , ); await user.click(getByLabelText("common.reactions")); await user.click(getByText("🐶")); @@ -120,7 +121,7 @@ test("Can fully expand emoji picker", async () => { const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); const { getByText, container, getByLabelText } = render( - , + , ); await user.click(getByLabelText("common.reactions")); await user.click(getByLabelText("action.show_more")); @@ -148,7 +149,7 @@ test("Can close reaction dialog", async () => { const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); const { getByLabelText, container } = render( - , + , ); await user.click(getByLabelText("common.reactions")); await user.click(getByLabelText("action.show_more")); diff --git a/src/room/CallEventAudioRenderer.test.tsx b/src/room/CallEventAudioRenderer.test.tsx index 19345b86..57809ff0 100644 --- a/src/room/CallEventAudioRenderer.test.tsx +++ b/src/room/CallEventAudioRenderer.test.tsx @@ -84,7 +84,9 @@ function TestComponent({ vm: CallViewModel; }): ReactNode { return ( - + ); diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index b0fa8c69..9336ffdd 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -331,7 +331,7 @@ export const GroupCallView: FC = ({ = { function TestComponent({ rtcSession, }: { - rtcSession: MockRTCSession; + rtcSession: MatrixRTCSession; }): ReactNode { return ( @@ -91,7 +92,9 @@ test("preloads all audio elements", () => { new MockRoom(memberUserIdAlice), membership, ); - render(); + render( + , + ); expect(prefetchSounds).toHaveBeenCalledOnce(); }); @@ -99,7 +102,9 @@ test("will play an audio sound when there is a reaction", () => { playReactionsSound.setValue(true); const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); - render(); + render( + , + ); // Find the first reaction with a sound effect const chosenReaction = ReactionSet.find((r) => !!r.sound); @@ -118,7 +123,9 @@ test("will play the generic audio sound when there is soundless reaction", () => playReactionsSound.setValue(true); const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); - render(); + render( + , + ); // Find the first reaction with a sound effect const chosenReaction = ReactionSet.find((r) => !r.sound); @@ -138,7 +145,9 @@ test("will play multiple audio sounds when there are multiple different reaction const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); - render(); + render( + , + ); // Find the first reaction with a sound effect const [reaction1, reaction2] = ReactionSet.filter((r) => !!r.sound); diff --git a/src/room/ReactionsOverlay.test.tsx b/src/room/ReactionsOverlay.test.tsx index 121594ab..a6dc263f 100644 --- a/src/room/ReactionsOverlay.test.tsx +++ b/src/room/ReactionsOverlay.test.tsx @@ -40,7 +40,9 @@ function TestComponent({ }): ReactNode { return ( - + @@ -57,7 +59,9 @@ test("defaults to showing no reactions", () => { new MockRoom(memberUserIdAlice), membership, ); - const { container } = render(); + const { container } = render( + , + ); expect(container.getElementsByTagName("span")).toHaveLength(0); }); @@ -66,7 +70,9 @@ test("shows a reaction when sent", () => { const reaction = ReactionSet[0]; const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); - const { getByRole } = render(); + const { getByRole } = render( + , + ); act(() => { room.testSendReaction(memberEventAlice, reaction, membership); }); @@ -80,7 +86,9 @@ test("shows two of the same reaction when sent", () => { const reaction = ReactionSet[0]; const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); - const { getAllByRole } = render(); + const { getAllByRole } = render( + , + ); act(() => { room.testSendReaction(memberEventAlice, reaction, membership); }); @@ -95,7 +103,9 @@ test("shows two different reactions when sent", () => { const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); const [reactionA, reactionB] = ReactionSet; - const { getAllByRole } = render(); + const { getAllByRole } = render( + , + ); act(() => { room.testSendReaction(memberEventAlice, reactionA, membership); }); @@ -115,6 +125,8 @@ test("hides reactions when reaction animations are disabled", () => { act(() => { room.testSendReaction(memberEventAlice, reaction, membership); }); - const { container } = render(); + const { container } = render( + , + ); expect(container.getElementsByTagName("span")).toHaveLength(0); }); diff --git a/src/useReactions.test.tsx b/src/useReactions.test.tsx index 6140793f..5d341255 100644 --- a/src/useReactions.test.tsx +++ b/src/useReactions.test.tsx @@ -60,7 +60,9 @@ describe("useReactions", () => { membership, ); const { queryByRole } = render( - + , ); @@ -70,7 +72,9 @@ describe("useReactions", () => { const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); const { queryByRole } = render( - + , ); @@ -83,7 +87,9 @@ describe("useReactions", () => { const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); const { queryByRole } = render( - + , ); @@ -107,7 +113,9 @@ describe("useReactions", () => { ]); const rtcSession = new MockRTCSession(room, membership); const { queryByRole } = render( - + , ); @@ -121,7 +129,9 @@ describe("useReactions", () => { ]); const rtcSession = new MockRTCSession(room, membership); const { queryByRole } = render( - + , ); @@ -135,7 +145,9 @@ describe("useReactions", () => { ]); const rtcSession = new MockRTCSession(room, membership); const { queryByRole } = render( - + , ); @@ -153,7 +165,9 @@ describe("useReactions", () => { ]); const rtcSession = new MockRTCSession(room, membership); const { queryByRole } = render( - + , ); @@ -163,7 +177,9 @@ describe("useReactions", () => { const room = new MockRoom(memberUserIdAlice); const rtcSession = new MockRTCSession(room, membership); const { queryByRole } = render( - + , ); diff --git a/src/utils/testReactions.tsx b/src/utils/testReactions.tsx index 9a19a5e6..dd55d40b 100644 --- a/src/utils/testReactions.tsx +++ b/src/utils/testReactions.tsx @@ -32,7 +32,7 @@ export const TestReactionsWrapper = ({ rtcSession, children, }: PropsWithChildren<{ - rtcSession: MockRTCSession; + rtcSession: MatrixRTCSession; }>): ReactNode => { return (