@@ -53,11 +53,13 @@ describe("NewRoomIntro", () => {
53
53
describe ( "for a DM Room" , ( ) => {
54
54
beforeEach ( ( ) => {
55
55
jest . spyOn ( DMRoomMap . shared ( ) , "getUserIdForRoomId" ) . mockReturnValue ( userId ) ;
56
- renderNewRoomIntro ( client , new Room ( roomId , client , client . getUserId ( ) ) ) ;
56
+ const room = new Room ( roomId , client , client . getUserId ( ) ) ;
57
+ room . name = "test_room" ;
58
+ renderNewRoomIntro ( client , room ) ;
57
59
} ) ;
58
60
59
61
it ( "should render the expected intro" , ( ) => {
60
- const expected = `This is the beginning of your direct message history with ${ userId } .` ;
62
+ const expected = `This is the beginning of your direct message history with test_room .` ;
61
63
screen . getByText ( ( id , element ) => element . tagName === "SPAN" && element . textContent === expected ) ;
62
64
} ) ;
63
65
} ) ;
@@ -66,12 +68,13 @@ describe("NewRoomIntro", () => {
66
68
beforeEach ( ( ) => {
67
69
jest . spyOn ( DMRoomMap . shared ( ) , "getUserIdForRoomId" ) . mockReturnValue ( userId ) ;
68
70
const localRoom = new LocalRoom ( roomId , client , client . getUserId ( ) ) ;
71
+ localRoom . name = "test_room" ;
69
72
localRoom . targets . push ( new DirectoryMember ( { user_id : userId } ) ) ;
70
73
renderNewRoomIntro ( client , localRoom ) ;
71
74
} ) ;
72
75
73
76
it ( "should render the expected intro" , ( ) => {
74
- const expected = `Send your first message to invite ${ userId } to chat` ;
77
+ const expected = `Send your first message to invite test_room to chat` ;
75
78
screen . getByText ( ( id , element ) => element . tagName === "SPAN" && element . textContent === expected ) ;
76
79
} ) ;
77
80
} ) ;
0 commit comments