Browse Source

spec/smacks: prevent two MUCs from being created

JC Brand 4 năm trước cách đây
mục cha
commit
fe17be24e0
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      spec/smacks.js

+ 3 - 3
spec/smacks.js

@@ -231,9 +231,8 @@ describe("XEP-0198 Stream Management", function () {
             })
         );
 
-        _converse.no_connection_on_bind = true; // XXX Don't trigger CONNECTED in tests/mock.js
+        _converse.no_connection_on_bind = true; // XXX Don't trigger CONNECTED in MockConnection
         await _converse.api.user.login('romeo@montague.lit', 'secret');
-        delete _converse.no_connection_on_bind;
 
         const sent_stanzas = _converse.connection.sent_stanzas;
         const stanza = await u.waitUntil(() => sent_stanzas.filter(s => (s.tagName === 'resume')).pop());
@@ -243,7 +242,6 @@ describe("XEP-0198 Stream Management", function () {
         _converse.connection._dataRecv(mock.createRequest(result));
         expect(_converse.session.get('smacks_enabled')).toBe(true);
 
-
         const nick = 'romeo';
         const func = _converse.chatboxes.onChatBoxesFetched;
         spyOn(_converse.chatboxes, 'onChatBoxesFetched').and.callFake(collection => {
@@ -274,6 +272,8 @@ describe("XEP-0198 Stream Management", function () {
 
         await u.waitUntil(() => muc.messages.length);
         expect(muc.messages.at(0).get('message')).toBe('First message')
+
+        delete _converse.no_connection_on_bind;
         done();
     }));
 });