Explorar el Código

Add a quick test for remembering of open tab.

JC Brand hace 9 años
padre
commit
64b5755d10
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  1. 11 0
      spec/controlbox.js

+ 11 - 0
spec/controlbox.js

@@ -1148,6 +1148,17 @@
             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 () {
             afterEach(function () {
                 converse_api.user.logout();