Commit 1565decf authored by JC Brand's avatar JC Brand

Add identifiable class name

parent c219d370
...@@ -6250,8 +6250,7 @@ body.reset { ...@@ -6250,8 +6250,7 @@ body.reset {
width: 100%; } width: 100%; }
#conversejs:not(.fullscreen) #minimized-chats .minimized-chats-flyout.minimized { #conversejs:not(.fullscreen) #minimized-chats .minimized-chats-flyout.minimized {
height: auto; } height: auto; }
#conversejs:not(.fullscreen) #minimized-chats .unread-message-count, #conversejs:not(.fullscreen) #minimized-chats .unread-message-count {
#conversejs:not(.fullscreen) #minimized-chats .chat-head-message-count {
font-weight: bold; font-weight: bold;
background-color: white; background-color: white;
border: 1px solid; border: 1px solid;
......
...@@ -64,8 +64,7 @@ ...@@ -64,8 +64,7 @@
} }
} }
.unread-message-count, .unread-message-count {
.chat-head-message-count {
font-weight: bold; font-weight: bold;
background-color: white; background-color: white;
border: 1px solid; border: 1px solid;
......
...@@ -40,8 +40,7 @@ ...@@ -40,8 +40,7 @@
} }
} }
.unread-message-count, .unread-message-count {
.chat-head-message-count {
font-weight: bold; font-weight: bold;
background-color: white; background-color: white;
border: 1px solid; border: 1px solid;
......
...@@ -487,24 +487,29 @@ ...@@ -487,24 +487,29 @@
null, ['rosterGroupsFetched'], {}, null, ['rosterGroupsFetched'], {},
function (done, _converse) { function (done, _converse) {
var timeout = true, $toolbar, view;
test_utils.createContacts(_converse, 'current'); test_utils.createContacts(_converse, 'current');
test_utils.openControlBox(); test_utils.openControlBox();
test_utils.waitUntil(function () { test_utils.waitUntil(function () {
return $(_converse.rosterview.el).find('.roster-group').length; return $(_converse.rosterview.el).find('.roster-group').length;
}, 300) }, 300).then(function () {
.then(function () {
// TODO: More tests can be added here... // TODO: More tests can be added here...
var contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; var contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost';
test_utils.openChatBoxFor(_converse, contact_jid); test_utils.openChatBoxFor(_converse, contact_jid);
var view = _converse.chatboxviews.get(contact_jid); view = _converse.chatboxviews.get(contact_jid);
var $toolbar = $(view.el).find('ul.chat-toolbar'); $toolbar = $(view.el).find('ul.chat-toolbar');
expect($toolbar.children('.toggle-otr').length).toBe(1); expect($toolbar.find('.toggle-otr').length).toBe(1);
// Register spies // Register spies
spyOn(view, 'toggleOTRMenu').and.callThrough(); spyOn(view, 'toggleOTRMenu').and.callThrough();
view.delegateEvents(); // We need to rebind all events otherwise our spy won't be called view.delegateEvents(); // We need to rebind all events otherwise our spy won't be called
timeout = false;
$toolbar[0].querySelector('.toggle-otr').click(); $toolbar[0].querySelector('.toggle-otr').click();
return test_utils.waitUntil(function () {
return view.el.querySelector('.otr-menu').offsetHeight;
}, 300)
}).then(function () {
expect(view.toggleOTRMenu).toHaveBeenCalled(); expect(view.toggleOTRMenu).toHaveBeenCalled();
done(); done();
}); });
...@@ -1360,7 +1365,7 @@ ...@@ -1360,7 +1365,7 @@
expect(_converse.emit).toHaveBeenCalledWith('message', jasmine.any(Object)); expect(_converse.emit).toHaveBeenCalledWith('message', jasmine.any(Object));
var trimmed_chatboxes = _converse.minimized_chats; var trimmed_chatboxes = _converse.minimized_chats;
var trimmedview = trimmed_chatboxes.get(contact_jid); var trimmedview = trimmed_chatboxes.get(contact_jid);
var $count = $(trimmedview.el).find('.chat-head-message-count'); var $count = $(trimmedview.el).find('.message-count');
expect(u.isVisible(chatview.el)).toBeFalsy(); expect(u.isVisible(chatview.el)).toBeFalsy();
expect(trimmedview.model.get('minimized')).toBeTruthy(); expect(trimmedview.model.get('minimized')).toBeTruthy();
expect(u.isVisible($count[0])).toBeTruthy(); expect(u.isVisible($count[0])).toBeTruthy();
...@@ -1376,7 +1381,7 @@ ...@@ -1376,7 +1381,7 @@
); );
expect(u.isVisible(chatview.el)).toBeFalsy(); expect(u.isVisible(chatview.el)).toBeFalsy();
expect(trimmedview.model.get('minimized')).toBeTruthy(); expect(trimmedview.model.get('minimized')).toBeTruthy();
$count = $(trimmedview.el).find('.chat-head-message-count'); $count = $(trimmedview.el).find('.message-count');
expect(u.isVisible($count[0])).toBeTruthy(); expect(u.isVisible($count[0])).toBeTruthy();
expect($count.html()).toBe('2'); expect($count.html()).toBe('2');
trimmedview.el.querySelector('.restore-chat').click(); trimmedview.el.querySelector('.restore-chat').click();
...@@ -2676,7 +2681,7 @@ ...@@ -2676,7 +2681,7 @@
}; };
var selectUnreadMsgCount = function () { var selectUnreadMsgCount = function () {
var minimizedChatBoxView = _converse.minimized_chats.get(sender_jid); var minimizedChatBoxView = _converse.minimized_chats.get(sender_jid);
return $(minimizedChatBoxView.el).find('.chat-head-message-count'); return $(minimizedChatBoxView.el).find('.message-count');
}; };
var chatbox = _converse.chatboxes.get(sender_jid); var chatbox = _converse.chatboxes.get(sender_jid);
...@@ -2706,7 +2711,7 @@ ...@@ -2706,7 +2711,7 @@
}; };
var selectUnreadMsgCount = function () { var selectUnreadMsgCount = function () {
var minimizedChatBoxView = _converse.minimized_chats.get(sender_jid); var minimizedChatBoxView = _converse.minimized_chats.get(sender_jid);
return $(minimizedChatBoxView.el).find('.chat-head-message-count'); return $(minimizedChatBoxView.el).find('.message-count');
}; };
var chatboxview = _converse.chatboxviews.get(sender_jid); var chatboxview = _converse.chatboxviews.get(sender_jid);
......
<a href="#" class="restore-chat w-100 align-self-center" title="{{{o.tooltip}}}"> <a href="#" class="restore-chat w-100 align-self-center" title="{{{o.tooltip}}}">
{[ if (o.num_unread) { ]} {[ if (o.num_unread) { ]}
<span class="badge badge-light">{{{o.num_unread}}}</span> <span class="message-count badge badge-light">{{{o.num_unread}}}</span>
{[ } ]} {[ } ]}
{{{o.title || o.jid }}} {{{o.title || o.jid }}}
</a> </a>
......
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