You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-31 13:44:28 +03:00
Use room name as room intro (#9231)
* Use roon name for room intro * Fix types * Revert caption var change * Fix type issue
This commit is contained in:
@ -53,12 +53,14 @@ describe("NewRoomIntro", () => {
|
||||
describe("for a DM Room", () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(DMRoomMap.shared(), "getUserIdForRoomId").mockReturnValue(userId);
|
||||
renderNewRoomIntro(client, new Room(roomId, client, client.getUserId()));
|
||||
const room = new Room(roomId, client, client.getUserId());
|
||||
room.name = "test_room";
|
||||
renderNewRoomIntro(client, room);
|
||||
});
|
||||
|
||||
it("should render the expected intro", () => {
|
||||
const expected = `This is the beginning of your direct message history with ${userId}.`;
|
||||
screen.getByText((id, element) => element.tagName === "SPAN" && element.textContent === expected);
|
||||
const expected = `This is the beginning of your direct message history with test_room.`;
|
||||
screen.getByText((id, element) => element?.tagName === "SPAN" && element?.textContent === expected);
|
||||
});
|
||||
});
|
||||
|
||||
@ -66,13 +68,14 @@ describe("NewRoomIntro", () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(DMRoomMap.shared(), "getUserIdForRoomId").mockReturnValue(userId);
|
||||
const localRoom = new LocalRoom(roomId, client, client.getUserId());
|
||||
localRoom.name = "test_room";
|
||||
localRoom.targets.push(new DirectoryMember({ user_id: userId }));
|
||||
renderNewRoomIntro(client, localRoom);
|
||||
});
|
||||
|
||||
it("should render the expected intro", () => {
|
||||
const expected = `Send your first message to invite ${userId} to chat`;
|
||||
screen.getByText((id, element) => element.tagName === "SPAN" && element.textContent === expected);
|
||||
const expected = `Send your first message to invite test_room to chat`;
|
||||
screen.getByText((id, element) => element?.tagName === "SPAN" && element?.textContent === expected);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user