diff --git a/spec/ChatBoxSpec.js b/spec/ChatBoxSpec.js index 786f4d285..2f685d927 100644 --- a/spec/ChatBoxSpec.js +++ b/spec/ChatBoxSpec.js @@ -8,22 +8,22 @@ ); } (this, function (mock, utils) { return describe("Chatboxes", $.proxy(function(mock, utils) { - window.localStorage.clear(); - describe("A Chatbox", $.proxy(function () { - beforeEach($.proxy(function () { - //utils.initRoster(); - //utils.createCurrentContacts(); - //utils.closeAllChatBoxes(); + beforeEach(function () { + utils.closeAllChatBoxes(); + utils.removeControlBox(); + converse.roster.localStorage._clear(); + utils.initConverse(); + utils.createCurrentContacts(); utils.openControlBox(); utils.openContactsPanel(); - }, converse)); + }); it("is created when you click on a roster item", $.proxy(function () { var i, $el, click, jid, view; - // showControlBox was called earlier, so the controlbox is + // openControlBox was called earlier, so the controlbox is // visible, but no other chat boxes have been created. - expect(this.chatboxes.length).toEqual(2); + expect(this.chatboxes.length).toEqual(1); var online_contacts = this.rosterview.$el.find('dt#xmpp-contacts').siblings('dd.current-xmpp-contact.online').find('a.open-chat'); for (i=0; i