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 @@
}));
});
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(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) {
......@@ -3980,15 +3980,15 @@
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) {
var sendIQ = _converse.connection.sendIQ;
var sent_stanza, IQ_id;
const sendIQ = _converse.connection.sendIQ;
let sent_stanza, IQ_id;
spyOn(_converse.connection, 'sendIQ').and.callFake(function (iq, callback, errback) {
sent_stanza = iq;
IQ_id = sendIQ.bind(this)(iq, callback, errback);
});
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();
test_utils.closeControlBox(_converse);
const modal = roomspanel.list_rooms_modal;
......@@ -4036,6 +4036,9 @@
expect(view.el.querySelector('.chat-head-chatroom').textContent.trim()).toBe("Macbeth's Castle");
done();
}));
});
describe("The \"Groupchats\" section", function () {
it("shows the number of unread mentions received",
mock.initConverse(
......@@ -4058,7 +4061,7 @@
const view = _converse.chatboxviews.get(room_jid);
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];
await view.model.onMessage($msg({
......@@ -4087,6 +4090,7 @@
expect(roomspanel.el.querySelectorAll('.msgs-indicator').length).toBe(0);
done();
}));
});
describe("A Chat Status Notification", function () {
......@@ -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