|
@@ -26,14 +26,14 @@
|
|
|
}, converse));
|
|
|
|
|
|
it("shows users currently present in the room", $.proxy(function () {
|
|
|
- var chatroomview = this.chatboxesview.views['lounge@muc.localhost'];
|
|
|
- chatroomview.renderChatArea();
|
|
|
- var $participant_list = chatroomview.$el.find('.participant-list');
|
|
|
+ var chatroomview = this.chatboxesview.views['lounge@muc.localhost'],
|
|
|
+ $participant_list;
|
|
|
var roster = {}, room = {}, i;
|
|
|
|
|
|
for (i=0; i<chatroom_names.length-1; i++) {
|
|
|
roster[chatroom_names[i]] = {};
|
|
|
chatroomview.onChatRoomRoster(roster, room);
|
|
|
+ $participant_list = chatroomview.$el.find('.participant-list');
|
|
|
expect($participant_list.find('li').length).toBe(1+i);
|
|
|
expect($($participant_list.find('li')[i]).text()).toBe(chatroom_names[i]);
|
|
|
}
|
|
@@ -43,12 +43,11 @@
|
|
|
|
|
|
it("indicates moderators by means of a special css class and tooltip", $.proxy(function () {
|
|
|
var chatroomview = this.chatboxesview.views['lounge@muc.localhost'];
|
|
|
- var $participant_list = chatroomview.$el.find('.participant-list');
|
|
|
var roster = {}, idx = chatroom_names.length-1;
|
|
|
roster[chatroom_names[idx]] = {};
|
|
|
roster[chatroom_names[idx]].role = 'moderator';
|
|
|
chatroomview.onChatRoomRoster(roster, {});
|
|
|
- occupant = $participant_list.find('li');
|
|
|
+ var occupant = chatroomview.$el.find('.participant-list').find('li');
|
|
|
expect(occupant.length).toBe(1);
|
|
|
expect($(occupant).text()).toBe(chatroom_names[idx]);
|
|
|
expect($(occupant).attr('class')).toBe('moderator');
|
|
@@ -209,7 +208,7 @@
|
|
|
spyOn(view, 'renderErrorMessage').andCallThrough();
|
|
|
view.onChatRoomPresence(presence, {'nick': 'dummy'});
|
|
|
expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
|
|
|
- expect(view.$el.find('.chat-body p').text()).toBe("Your nickname doesn't conform to the room's policies");
|
|
|
+ expect(view.$el.find('.chat-body p').text()).toBe("Your nickname doesn't conform to this room's policies");
|
|
|
}, converse));
|
|
|
|
|
|
it("will show an error message if the user's nickname is already taken", $.proxy(function () {
|