Add a quick test for remembering of open tab.

This commit is contained in:
JC Brand 2016-11-03 14:10:08 +00:00
parent a2f4acdcee
commit 64b5755d10

View File

@ -1148,6 +1148,17 @@
expect($panels.children().last().is(':visible')).toBe(false); expect($panels.children().last().is(':visible')).toBe(false);
})); }));
it("remembers which tab was open last", mock.initConverse(function (converse) {
test_utils.openControlBox();
var cbview = converse.chatboxviews.get('controlbox');
var $tabs = cbview.$el.find('#controlbox-tabs');
expect(cbview.model.get('active-panel')).toBe('users');
$tabs.find('li').last().find('a').click();
expect(cbview.model.get('active-panel')).toBe('chatrooms');
$tabs.find('li').first().find('a').click();
expect(cbview.model.get('active-panel')).toBe('users');
}));
describe("chatrooms panel", function () { describe("chatrooms panel", function () {
afterEach(function () { afterEach(function () {
converse_api.user.logout(); converse_api.user.logout();