Browse Source

Clean up after running tests, by closing chatboxes.

JC Brand 11 years ago
parent
commit
4e9dc08b0b
2 changed files with 8 additions and 0 deletions
  1. 4 0
      spec/chatbox.js
  2. 4 0
      spec/chatroom.js

+ 4 - 0
spec/chatbox.js

@@ -19,6 +19,10 @@
                 utils.openContactsPanel();
                 utils.openContactsPanel();
             });
             });
 
 
+            afterEach(function () {
+                utils.closeAllChatBoxes();
+            });
+
             it("is created when you click on a roster item", $.proxy(function () {
             it("is created when you click on a roster item", $.proxy(function () {
                 var i, $el, click, jid, view;
                 var i, $el, click, jid, view;
                 // openControlBox was called earlier, so the controlbox is
                 // openControlBox was called earlier, so the controlbox is

+ 4 - 0
spec/chatroom.js

@@ -14,6 +14,10 @@
                 utils.createNewChatRoom('lounge', 'dummy');
                 utils.createNewChatRoom('lounge', 'dummy');
             });
             });
 
 
+            afterEach(function () {
+                utils.closeAllChatBoxes();
+            });
+
             it("shows users currently present in the room", $.proxy(function () {
             it("shows users currently present in the room", $.proxy(function () {
                 var chatroomview = this.chatboxesview.views['lounge@muc.localhost'],
                 var chatroomview = this.chatboxesview.views['lounge@muc.localhost'],
                     $participant_list;
                     $participant_list;