Add test for muc_respect_autojoin

This commit is contained in:
JC Brand 2019-03-27 08:34:36 +01:00
parent b81fa43a74
commit 298300e890
2 changed files with 13 additions and 0 deletions

View File

@ -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',

View File

@ -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();
}));