From eefce8286e72b43213fdeabdda14e9f994dc79f4 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Wed, 17 Sep 2014 10:35:24 +0200 Subject: [PATCH] Fix tests but killing zombies. --- converse.js | 15 ++++++++++++--- tests/utils.js | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/converse.js b/converse.js index 28548da22..4f980034d 100644 --- a/converse.js +++ b/converse.js @@ -1455,9 +1455,7 @@ }, minimize: function (ev) { - if (ev && ev.preventDefault) { - ev.preventDefault(); - } + if (ev && ev.preventDefault) { ev.preventDefault(); } // Minimizes a chat box this.model.minimize(); this.$el.hide('fast', converse.refreshwebkit); @@ -4509,6 +4507,17 @@ } }; + this._tearDown = function () { + this.features.off().remove(); + this.otr.destroy(); + this.chatboxes.off().remove(); + this.chatboxviews.off().remove(); + this.controlboxtoggle.off().remove(); + this.minimized_chats.off().remove(); + delete this.chatboxes; + delete this.features; + }; + this._initialize = function () { this.chatboxes = new this.ChatBoxes(); this.chatboxviews = new this.ChatBoxViews({model: this.chatboxes}); diff --git a/tests/utils.js b/tests/utils.js index 373c7f7a9..a1c37f9c2 100644 --- a/tests/utils.js +++ b/tests/utils.js @@ -31,8 +31,8 @@ }; utils.initConverse = function () { + converse._tearDown(); converse._initialize(); - converse.onConnected(); }; utils.initRoster = function () {