From 298300e890d7d499f6cbc3d47ad2b8aca3853854 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Wed, 27 Mar 2019 08:34:36 +0100 Subject: [PATCH] Add test for muc_respect_autojoin --- dev.html | 1 + spec/bookmarks.js | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/dev.html b/dev.html index 808711a0e..c2685792c 100644 --- a/dev.html +++ b/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', diff --git a/spec/bookmarks.js b/spec/bookmarks.js index 1efdc2644..802f3202c 100644 --- a/spec/bookmarks.js +++ b/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(); }));