Commit cc28f7e8 authored by JC Brand's avatar JC Brand

Add a test to check that moderators are highlighted

parent 6d9fe68a
......@@ -29,7 +29,8 @@
var chatroomview = this.chatboxesview.views['lounge@muc.localhost'];
var $participant_list = chatroomview.$el.find('.participant-list');
var roster = {}, room = {}, i;
for (i=0; i<chatroom_names.length; i++) {
for (i=0; i<chatroom_names.length-1; i++) {
roster[chatroom_names[i]] = {};
chatroomview.onChatRoomRoster(roster, room);
expect($participant_list.find('li').length).toBe(1+i);
......@@ -39,6 +40,20 @@
chatroomview.onChatRoomRoster(roster, room);
}, converse));
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');
expect(occupant.length).toBe(1);
expect($(occupant).text()).toBe(chatroom_names[idx]);
expect($(occupant).attr('class')).toBe('moderator');
expect($(occupant).attr('title')).toBe('This user is a moderator');
}, converse));
it("can be saved to, and retrieved from, localStorage", $.proxy(function () {
// We instantiate a new ChatBoxes collection, which by default
// will be empty.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment