@@ -53,11 +53,13 @@ describe("NewRoomIntro", () => {
5353 describe ( "for a DM Room" , ( ) => {
5454 beforeEach ( ( ) => {
5555 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 ) ;
5759 } ) ;
5860
5961 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 .` ;
6163 screen . getByText ( ( id , element ) => element . tagName === "SPAN" && element . textContent === expected ) ;
6264 } ) ;
6365 } ) ;
@@ -66,12 +68,13 @@ describe("NewRoomIntro", () => {
6668 beforeEach ( ( ) => {
6769 jest . spyOn ( DMRoomMap . shared ( ) , "getUserIdForRoomId" ) . mockReturnValue ( userId ) ;
6870 const localRoom = new LocalRoom ( roomId , client , client . getUserId ( ) ) ;
71+ localRoom . name = "test_room" ;
6972 localRoom . targets . push ( new DirectoryMember ( { user_id : userId } ) ) ;
7073 renderNewRoomIntro ( client , localRoom ) ;
7174 } ) ;
7275
7376 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` ;
7578 screen . getByText ( ( id , element ) => element . tagName === "SPAN" && element . textContent === expected ) ;
7679 } ) ;
7780 } ) ;
0 commit comments