diff --git a/src/useReactions.test.tsx b/src/useReactions.test.tsx
index 6140793f..3fb43247 100644
--- a/src/useReactions.test.tsx
+++ b/src/useReactions.test.tsx
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
*/
-import { render } from "@testing-library/react";
+import { findByRole, getByRole, render } from "@testing-library/react";
import { act, FC } from "react";
import { describe, expect, test } from "vitest";
import { RoomEvent } from "matrix-js-sdk/src/matrix";
@@ -43,7 +43,7 @@ const TestComponent: FC = () => {
{Object.entries(raisedHands).map(([userId, date]) => (
- -
+
-
{userId}
@@ -106,12 +106,12 @@ describe("useReactions", () => {
createHandRaisedReaction(memberEventAlice, membership),
]);
const rtcSession = new MockRTCSession(room, membership);
- const { queryByRole } = render(
+ const { findByRole } = render(
,
);
- expect(queryByRole("list")?.children).to.have.lengthOf(1);
+ expect(findByRole("listitem")).toBeTruthy();
});
// If the membership event changes for a user, we want to remove
// the raised hand event.
@@ -120,12 +120,12 @@ describe("useReactions", () => {
createHandRaisedReaction(memberEventAlice, membership),
]);
const rtcSession = new MockRTCSession(room, membership);
- const { queryByRole } = render(
+ const { findByRole, queryByRole } = render(
,
);
- expect(queryByRole("list")?.children).to.have.lengthOf(1);
+ expect(findByRole("listitem")).toBeTruthy();
act(() => rtcSession.testRemoveMember(memberUserIdAlice));
expect(queryByRole("list")?.children).to.have.lengthOf(0);
});
@@ -134,12 +134,12 @@ describe("useReactions", () => {
createHandRaisedReaction(memberEventAlice, membership),
]);
const rtcSession = new MockRTCSession(room, membership);
- const { queryByRole } = render(
+ const { queryByRole, findByRole } = render(
,
);
- expect(queryByRole("list")?.children).to.have.lengthOf(1);
+ expect(findByRole("listitem")).toBeTruthy();
// Simulate leaving and rejoining
act(() => {
rtcSession.testRemoveMember(memberUserIdAlice);
diff --git a/src/useReactions.tsx b/src/useReactions.tsx
index c6412c83..ce527eab 100644
--- a/src/useReactions.tsx
+++ b/src/useReactions.tsx
@@ -143,7 +143,6 @@ export const ReactionsProvider = ({
);
allEvents = res.chunk.map((e) => new MatrixEvent(e));
}
-
return allEvents.find(
(reaction) =>
reaction.event.sender === expectedSender &&