Browse Source

Add test for muc_respect_autojoin

JC Brand 6 years ago
parent
commit
298300e890
2 changed files with 13 additions and 0 deletions
  1. 1 0
      dev.html
  2. 12 0
      spec/bookmarks.js

+ 1 - 0
dev.html

@@ -30,6 +30,7 @@
         notify_all_room_messages: [
             'discuss@conference.conversejs.org'
         ],
+        muc_respect_autojoin: false,
         // bosh_service_url: 'http://chat.example.org:5280/http-bind/',
         bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes
         message_archiving: 'always',

+ 12 - 0
spec/bookmarks.js

@@ -154,6 +154,7 @@
                 [{'category': 'pubsub', 'type': 'pep'}],
                 ['http://jabber.org/protocol/pubsub#publish-options']
             );
+            await test_utils.waitUntil(() => _converse.bookmarks);
             let jid = 'lounge@localhost';
             _converse.bookmarks.create({
                 'jid': jid,
@@ -171,6 +172,17 @@
                 'nick': ' Othello'
             });
             expect(_.isUndefined(_converse.chatboxviews.get(jid))).toBeFalsy();
+
+            // Check that we don't auto-join if muc_respect_autojoin is false
+            _converse.muc_respect_autojoin = false;
+            jid = 'balcony@conference.shakespeare.lit';
+            _converse.bookmarks.create({
+                'jid': jid,
+                'autojoin': true,
+                'name':  'Balcony',
+                'nick': ' Othello'
+            });
+            expect(_.isUndefined(_converse.chatboxviews.get(jid))).toBe(true);
             done();
         }));