瀏覽代碼

Fix (some) tests.

JC Brand 10 年之前
父節點
當前提交
5124c05f65
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 2 1
      spec/chatroom.js
  2. 2 0
      tests/mock.js

+ 2 - 1
spec/chatroom.js

@@ -12,6 +12,7 @@
             beforeEach(function () {
                 runs(function () {
                     test_utils.closeAllChatBoxes();
+                    test_utils.clearBrowserStorage();
                 });
             });
 
@@ -261,7 +262,7 @@
                 var $chat_content = view.$el.find('.chat-content');
                 expect($chat_content.length).toBe(0); // There shouldn't be a chat content area anymore
                 var $chat_body = view.$el.find('.chat-body');
-                expect($chat_body.html()).toBe('<p>You have been kicked from this room</p><p>The reason given is: "Avaunt, you cullion!"</p>');
+                expect($chat_body.html().trim()).toBe('<p>You have been kicked from this room</p><p>The reason given is: "Avaunt, you cullion!"</p>');
             }, converse));
 
             it("can be saved to, and retrieved from, browserStorage", $.proxy(function () {

+ 2 - 0
tests/mock.js

@@ -38,6 +38,8 @@
 
     mock.mock_connection = {
         '_proto': {},
+        'connected': true,
+        'authenticated': true,
         'mock': true,
         'muc': {
             'listRooms': function () {},