Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 663c7e0

Browse files
author
Germain
authored
Migrate useTopic test to RTL (#9580)
1 parent c10339a commit 663c7e0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/useTopic-test.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ limitations under the License.
1616

1717
import React from "react";
1818
import { Room } from "matrix-js-sdk/src/models/room";
19-
// eslint-disable-next-line deprecate/import
20-
import { mount } from "enzyme";
2119
import { act } from "react-dom/test-utils";
20+
import { render, screen } from "@testing-library/react";
2221

2322
import { useTopic } from "../src/hooks/room/useTopic";
2423
import { mkEvent, stubClient } from "./test-utils";
@@ -46,9 +45,9 @@ describe("useTopic", () => {
4645
return <p>{ topic.text }</p>;
4746
}
4847

49-
const wrapper = mount(<RoomTopic />);
48+
render(<RoomTopic />);
5049

51-
expect(wrapper.text()).toBe("Test topic");
50+
expect(screen.queryByText("Test topic")).toBeInTheDocument();
5251

5352
const updatedTopic = mkEvent({
5453
type: 'm.room.topic',
@@ -65,6 +64,6 @@ describe("useTopic", () => {
6564
room.addLiveEvents([updatedTopic]);
6665
});
6766

68-
expect(wrapper.text()).toBe("New topic");
67+
expect(screen.queryByText("New topic")).toBeInTheDocument();
6968
});
7069
});

0 commit comments

Comments
 (0)