Forráskód Böngészése

Fix failing test.

JC Brand 8 éve
szülő
commit
fe2a925c88
1 módosított fájl, 9 hozzáadás és 7 törlés
  1. 9 7
      spec/xmppstatus.js

+ 9 - 7
spec/xmppstatus.js

@@ -5,17 +5,19 @@
 
     return describe("The XMPPStatus model", function() {
 
-        it("won't send <show>online when setting a custom status message", mock.initConverse(function (_converse) {
+        it("won't send <show>online</show> when setting a custom status message", mock.initConverse(function (_converse) {
             _converse.xmppstatus.save({'status': 'online'});
             spyOn(_converse.xmppstatus, 'setStatusMessage').andCallThrough();
             spyOn(_converse.connection, 'send');
             _converse.xmppstatus.setStatusMessage("I'm also happy!");
-            runs (function () {
-                expect(_converse.connection.send).toHaveBeenCalled();
-                var $stanza = $(_converse.connection.send.argsForCall[0][0].tree());
-                expect($stanza.children().length).toBe(1);
-                expect($stanza.children('show').length).toBe(0);
-            });
+            expect(_converse.connection.send).toHaveBeenCalled();
+            var $stanza = $(_converse.connection.send.argsForCall[0][0].tree());
+            expect($stanza.children().length).toBe(2);
+            expect($stanza.children('status').length).toBe(1);
+            expect($stanza.children('status').text()).toBe("I'm also happy!");
+            expect($stanza.children('show').length).toBe(0);
+            expect($stanza.children('priority').length).toBe(1);
+            expect($stanza.children('priority').text()).toBe('0');
         }));
     });
 }));