Parcourir la source

Fix failing tests due to renames

JC Brand il y a 7 ans
Parent
commit
4cefc7cdf9
3 fichiers modifiés avec 29 ajouts et 29 suppressions
  1. 20 20
      spec/chatroom.js
  2. 8 8
      spec/roomslist.js
  3. 1 1
      src/converse-muc-views.js

+ 20 - 20
spec/chatroom.js

@@ -54,7 +54,7 @@
                 }).catch(_.partial(console.error, _));
             }));
 
-            it("has a method 'get' which returns a wrapped chat room (if it exists)",
+            it("has a method 'get' which returns a wrapped groupchat (if it exists)",
                 mock.initConverseWithPromises(
                     null, ['rosterGroupsFetched'], {},
                     function (done, _converse) {
@@ -126,7 +126,7 @@
                 }, 300).then(function () {
                     var jid = 'lounge@localhost';
                     var room = _converse.api.rooms.open(jid);
-                    // Test on chat room that's not yet open
+                    // Test on groupchat that's not yet open
                     expect(room instanceof Object).toBeTruthy();
                     var chatroomview = _converse.chatboxviews.get(jid);
                     expect(chatroomview.is_chatroom).toBeTruthy();
@@ -275,7 +275,7 @@
             }));
         });
 
-        describe("An instant chat room", function () {
+        describe("An instant groupchat", function () {
 
             it("will be created when muc_instant_rooms is set to true",
                 mock.initConverseWithPromises(
@@ -407,9 +407,9 @@
             }));
         });
 
-        describe("A Chat Room", function () {
+        describe("A Groupchat", function () {
 
-            it("shows join/leave messages when users enter or exit a room",
+            it("shows join/leave messages when users enter or exit a groupchat",
                 mock.initConverseWithPromises(
                     null, ['rosterGroupsFetched'], {},
                     function (done, _converse) {
@@ -664,7 +664,7 @@
 
                     jasmine.clock().tick(ONE_DAY_LATER);
 
-                    // Test a user leaving a chat room
+                    // Test a user leaving a groupchat
                     presence = $pres({
                             to: 'dummy@localhost/_converse.js-29092160',
                             type: 'unavailable',
@@ -738,7 +738,7 @@
 
                     jasmine.clock().tick(ONE_DAY_LATER);
 
-                    // Test a user leaving a chat room
+                    // Test a user leaving a groupchat
                     presence = $pres({
                             to: 'dummy@localhost/_converse.js-29092160',
                             type: 'unavailable',
@@ -1419,7 +1419,7 @@
                 });
             }));
 
-            it("allows the user to invite their roster contacts to enter the chat room",
+            it("allows the user to invite their roster contacts to enter the groupchat",
                 mock.initConverseWithPromises(
                     null, ['rosterGroupsFetched'], {},
                     function (done, _converse) {
@@ -1497,7 +1497,7 @@
                     var name = mock.cur_names[0];
                     var from_jid = name.replace(/ /g,'.').toLowerCase() + '@localhost';
                     var room_jid = 'lounge@localhost';
-                    var reason = "Please join this chat room";
+                    var reason = "Please join this groupchat";
 
                     expect(_converse.chatboxes.models.length).toBe(1);
                     expect(_converse.chatboxes.models[0].id).toBe("controlbox");
@@ -1508,7 +1508,7 @@
                         '</message>').firstChild;
                     _converse.onDirectMUCInvitation(stanza);
                     expect(window.confirm).toHaveBeenCalledWith(
-                        name + ' has invited you to join a chat room: '+ room_jid +
+                        name + ' has invited you to join a groupchat: '+ room_jid +
                         ', and left the following reason: "'+reason+'"');
                     expect(_converse.chatboxes.models.length).toBe(2);
                     expect(_converse.chatboxes.models[0].id).toBe('controlbox');
@@ -1959,7 +1959,7 @@
                 });
             }));
 
-            it("informs users if they have been kicked out of the chat room",
+            it("informs users if they have been kicked out of the groupchat",
                 mock.initConverseWithPromises(
                     null, ['rosterGroupsFetched'], {},
                     function (done, _converse) {
@@ -2871,7 +2871,7 @@
                     spyOn(view, 'showErrorMessage').and.callThrough();
                     _converse.connection._dataRecv(test_utils.createRequest(presence));
                     expect(view.el.querySelector('.chatroom-body .disconnect-container .disconnect-msg:last-child').textContent)
-                        .toBe('You are not allowed to create new rooms.');
+                        .toBe('You are not allowed to create new groupchats.');
                     done();
                 }).catch(_.partial(console.error, _));
             }));
@@ -2949,9 +2949,9 @@
             }));
         });
 
-        describe("Someone being invited to a chat room", function () {
+        describe("Someone being invited to a groupchat", function () {
 
-            it("will first be added to the member list if the chat room is members only",
+            it("will first be added to the member list if the groupchat is members only",
                 mock.initConverseWithPromises(
                     null, ['rosterGroupsFetched'], {},
                     function (done, _converse) {
@@ -3002,7 +3002,7 @@
                    });
                    var name = mock.cur_names[0];
                    invitee_jid = name.replace(/ /g,'.').toLowerCase() + '@localhost';
-                   var reason = "Please join this chat room";
+                   var reason = "Please join this groupchat";
                    view.model.directInvite(invitee_jid, reason);
 
                    // Check in reverse order that we requested all three lists
@@ -3088,7 +3088,7 @@
                     var iq = "<iq to='coven@chat.shakespeare.lit' type='set' xmlns='jabber:client' id='"+IQ_ids.pop()+"'>"+
                             "<query xmlns='http://jabber.org/protocol/muc#admin'>"+
                                 "<item affiliation='member' jid='"+invitee_jid+"'>"+
-                                    "<reason>Please join this chat room</reason>"+
+                                    "<reason>Please join this groupchat</reason>"+
                                 "</item>"+
                             "</query>"+
                         "</iq>";
@@ -3097,7 +3097,7 @@
                     // Finally check that the user gets invited.
                     expect(sent_stanza.toLocaleString()).toBe( // Strophe adds the xmlns attr (although not in spec)
                         "<message from='dummy@localhost/resource' to='"+invitee_jid+"' id='"+sent_id+"' xmlns='jabber:client'>"+
-                            "<x xmlns='jabber:x:conference' jid='coven@chat.shakespeare.lit' reason='Please join this chat room'/>"+
+                            "<x xmlns='jabber:x:conference' jid='coven@chat.shakespeare.lit' reason='Please join this groupchat'/>"+
                         "</message>"
                     );
                     done();
@@ -3170,7 +3170,7 @@
             }));
         });
 
-        describe("The \"Chatrooms\" section", function () {
+        describe("The \"Groupchats\" section", function () {
 
             it("contains a link to a modal through which a new chatroom can be created",
                 mock.initConverseWithPromises(
@@ -3198,7 +3198,7 @@
                 }).catch(_.partial(console.error, _));
             }));
 
-            it("contains a link to a modal which can list rooms publically available on the server",
+            it("contains a link to a modal which can list groupchats publically available on the server",
                 mock.initConverseWithPromises(
                     null, ['rosterGroupsFetched'], {},
                     function (done, _converse) {
@@ -3253,7 +3253,7 @@
                     expect(modal.el.querySelectorAll('.available-chatrooms li').length).toBe(5);
 
                     const rooms = modal.el.querySelectorAll('.available-chatrooms li');
-                    expect(rooms[0].textContent.trim()).toBe("Rooms found:");
+                    expect(rooms[0].textContent.trim()).toBe("Groupchats found:");
                     expect(rooms[1].textContent.trim()).toBe("A Lonely Heath");
                     expect(rooms[2].textContent.trim()).toBe("A Dark Cave");
                     expect(rooms[3].textContent.trim()).toBe("The Palace");

+ 8 - 8
spec/roomslist.js

@@ -154,17 +154,17 @@
                 const modal = view.model.room_details_modal;
                 let els = modal.el.querySelectorAll('p.room-info');
                 expect(els[0].textContent).toBe("Name: A Dark Cave")
-                expect(els[1].textContent).toBe("Room address (JID): coven@chat.shakespeare.lit")
+                expect(els[1].textContent).toBe("Groupchat address (JID): coven@chat.shakespeare.lit")
                 expect(els[2].textContent).toBe("Description: This is the description")
                 expect(els[3].textContent).toBe("Online users: 1")
                 const features_list = modal.el.querySelector('.features-list');
                 expect(features_list.textContent.replace(/(\n|\s{2,})/g, '')).toBe(
-                    'Password protected - This room requires a password before entry'+
-                    'Hidden - This room is not publicly searchable'+
-                    'Open - Anyone can join this room'+
-                    'Temporary - This room will disappear once the last person leaves'+
-                    'Not anonymous - All other room occupants can see your XMPP username'+
-                    'Not moderated - This room is not being moderated'
+                    'Password protected - This groupchat requires a password before entry'+
+                    'Hidden - This groupchat is not publicly searchable'+
+                    'Open - Anyone can join this groupchat'+
+                    'Temporary - This groupchat will disappear once the last person leaves'+
+                    'Not anonymous - All other groupchat participants can see your XMPP username'+
+                    'Not moderated - This groupchat is not being moderated'
                 );
                 const presence = $pres({
                         to: 'dummy@localhost/_converse.js-29092160',
@@ -184,7 +184,7 @@
                 view.model.set({'subject': {'author': 'someone', 'text': 'Hatching dark plots'}});
                 els = modal.el.querySelectorAll('p.room-info');
                 expect(els[0].textContent).toBe("Name: A Dark Cave")
-                expect(els[1].textContent).toBe("Room address (JID): coven@chat.shakespeare.lit")
+                expect(els[1].textContent).toBe("Groupchat address (JID): coven@chat.shakespeare.lit")
                 expect(els[2].textContent).toBe("Description: This is the description")
                 expect(els[3].textContent).toBe("Topic: Hatching dark plots")
                 expect(els[4].textContent).toBe("Topic author: someone")

+ 1 - 1
src/converse-muc-views.js

@@ -396,7 +396,7 @@
                         // For translators: %1$s is a variable and will be
                         // replaced with the XMPP server name
                         available_chatrooms.innerHTML = tpl_rooms_results({
-                            'feedback_text': __('groupchats found:')
+                            'feedback_text': __('Groupchats found:')
                         });
                         const fragment = document.createDocumentFragment();
                         const children = _.reject(_.map(this.rooms, this.roomStanzaItemToHTMLElement), _.isNil)