2
0
Эх сурвалжийг харах

Make sure sessionStorage is cleared

JC Brand 11 жил өмнө
parent
commit
718f75a464

+ 5 - 0
spec/controlbox.js

@@ -203,6 +203,11 @@
 
         describe("Existing Contacts", $.proxy(function () {
             beforeEach($.proxy(function () {
+                runs(function () {
+                    converse.rosterview.model.reset();
+                    converse.rosterview.render();
+                });
+                waits(50);
                 runs(function () {
                     utils.openControlBox();
                 });

+ 1 - 0
spec/eventemitter.js

@@ -9,6 +9,7 @@
 } (this, function (mock, utils) {
     return describe("The Converse Event Emitter", $.proxy(function(mock, utils) {
         window.localStorage.clear();
+        window.sessionStorage.clear();
 
         it("allows you to subscribe to emitted events", function () {
             this.callback = function () {};

+ 1 - 0
tests/main.js

@@ -39,6 +39,7 @@ require([
         // Set up converse.js
         window.converse_api = converse;
         window.localStorage.clear();
+        window.sessionStorage.clear();
         converse.initialize({
             prebind: false,
             xhr_user_search: false,

+ 5 - 0
tests/utils.js

@@ -89,6 +89,11 @@
         return converse.rosterview.get(jid).openChat(mock.event);
     };
 
+    utils.clearBrowserStorage = function () {
+        window.localStorage.clear();
+        window.sessionStorage.clear();
+    };
+
     utils.clearChatBoxMessages = function (jid) {
         var view = converse.chatboxviews.get(jid);
         view.$el.find('.chat-content').empty();