Commit 36b912f0 authored by JC Brand's avatar JC Brand

Reorganize tests.

* CSN tests don't belong under "Groupchats" section tests.
* Move modal tests to their own grouping
parent 44e7275d
...@@ -3950,9 +3950,9 @@ ...@@ -3950,9 +3950,9 @@
})); }));
}); });
describe("The \"Groupchats\" section", function () { describe("The \"Groupchats\" Add modal", function () {
it("contains a link to a modal through which a new chatroom can be created", it("can be opened from a link in the \"Groupchats\" section of the controlbox",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, null, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
...@@ -3980,15 +3980,15 @@ ...@@ -3980,15 +3980,15 @@
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, null, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
var sendIQ = _converse.connection.sendIQ; const sendIQ = _converse.connection.sendIQ;
var sent_stanza, IQ_id; let sent_stanza, IQ_id;
spyOn(_converse.connection, 'sendIQ').and.callFake(function (iq, callback, errback) { spyOn(_converse.connection, 'sendIQ').and.callFake(function (iq, callback, errback) {
sent_stanza = iq; sent_stanza = iq;
IQ_id = sendIQ.bind(this)(iq, callback, errback); IQ_id = sendIQ.bind(this)(iq, callback, errback);
}); });
test_utils.openControlBox(); test_utils.openControlBox();
var roomspanel = _converse.chatboxviews.get('controlbox').roomspanel; const roomspanel = _converse.chatboxviews.get('controlbox').roomspanel;
roomspanel.el.querySelector('.show-list-muc-modal').click(); roomspanel.el.querySelector('.show-list-muc-modal').click();
test_utils.closeControlBox(_converse); test_utils.closeControlBox(_converse);
const modal = roomspanel.list_rooms_modal; const modal = roomspanel.list_rooms_modal;
...@@ -4036,6 +4036,9 @@ ...@@ -4036,6 +4036,9 @@
expect(view.el.querySelector('.chat-head-chatroom').textContent.trim()).toBe("Macbeth's Castle"); expect(view.el.querySelector('.chat-head-chatroom').textContent.trim()).toBe("Macbeth's Castle");
done(); done();
})); }));
});
describe("The \"Groupchats\" section", function () {
it("shows the number of unread mentions received", it("shows the number of unread mentions received",
mock.initConverse( mock.initConverse(
...@@ -4058,7 +4061,7 @@ ...@@ -4058,7 +4061,7 @@
const view = _converse.chatboxviews.get(room_jid); const view = _converse.chatboxviews.get(room_jid);
view.model.set({'minimized': true}); view.model.set({'minimized': true});
var contact_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@localhost'; const contact_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@localhost';
const nick = mock.chatroom_names[0]; const nick = mock.chatroom_names[0];
await view.model.onMessage($msg({ await view.model.onMessage($msg({
...@@ -4087,6 +4090,7 @@ ...@@ -4087,6 +4090,7 @@
expect(roomspanel.el.querySelectorAll('.msgs-indicator').length).toBe(0); expect(roomspanel.el.querySelectorAll('.msgs-indicator').length).toBe(0);
done(); done();
})); }));
});
describe("A Chat Status Notification", function () { describe("A Chat Status Notification", function () {
...@@ -4393,5 +4397,4 @@ ...@@ -4393,5 +4397,4 @@
}); });
}); });
}); });
});
})); }));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment