Commit 3cc99374 authored by JC Brand's avatar JC Brand

Fix failing tests

parent cf7d2fb6
...@@ -214,12 +214,12 @@ ...@@ -214,12 +214,12 @@
describe("The \"contacts\" API", function () { describe("The \"contacts\" API", function () {
it("has a method 'get' which returns wrapped contacts", mock.initConverse(async (done, _converse) => { it("has a method 'get' which returns wrapped contacts",
// Check that it returns nothing if a non-existing JID is given mock.initConverse(
test_utils.createContacts(_converse, 'current'); null, ['emojisInitialized'], {},
// Hack to avoid having to fetch the roster again. async function (done, _converse) {
_converse.session.set('roster_fetched', true);
await test_utils.waitForRoster(_converse, 'current');
let contact = await _converse.api.contacts.get('non-existing@jabber.org'); let contact = await _converse.api.contacts.get('non-existing@jabber.org');
expect(contact).toBeFalsy(); expect(contact).toBeFalsy();
// Check when a single jid is given // Check when a single jid is given
......
...@@ -170,14 +170,15 @@ ...@@ -170,14 +170,15 @@
describe("When not supported", function () { describe("When not supported", function () {
describe("A file upload toolbar button", function () { describe("A file upload toolbar button", function () {
it("does not appear in private chats", mock.initConverse(async (done, _converse) => { it("does not appear in private chats",
var contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; mock.initConverse(
test_utils.createContacts(_converse, 'current'); null, ['emojisInitialized'], {},
// Hack to avoid having to fetch the roster again. async function (done, _converse) {
_converse.session.set('roster_fetched', true);
test_utils.openChatBoxFor(_converse, contact_jid);
await test_utils.waitForRoster(_converse, 'current', 3);
test_utils.openControlBox();
const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit';
await test_utils.openChatBoxFor(_converse, contact_jid);
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
_converse, _converse.domain, _converse, _converse.domain,
[{'category': 'server', 'type':'IM'}], [{'category': 'server', 'type':'IM'}],
......
...@@ -19,11 +19,7 @@ ...@@ -19,11 +19,7 @@
null, ['rosterGroupsFetched'], {}, null, ['rosterGroupsFetched'], {},
async (done, _converse) => { async (done, _converse) => {
// TODO: not yet testing show_desktop_notifications setting await test_utils.waitForRoster(_converse, 'current');
await test_utils.createContacts(_converse, 'current');
// Hack to avoid having to fetch the roster again.
_converse.session.set('roster_fetched', true);
spyOn(_converse, 'showMessageNotification').and.callThrough(); spyOn(_converse, 'showMessageNotification').and.callThrough();
spyOn(_converse, 'areDesktopNotificationsEnabled').and.returnValue(true); spyOn(_converse, 'areDesktopNotificationsEnabled').and.returnValue(true);
spyOn(_converse, 'isMessageToHiddenChat').and.returnValue(true); spyOn(_converse, 'isMessageToHiddenChat').and.returnValue(true);
......
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