Commit 397927b1 authored by JC Brand's avatar JC Brand

Fix broken tests and update changelog

parent 6af02904
......@@ -2,7 +2,9 @@
## 3.2.0 (Unreleased)
- #866 Add babel in order to support ES2015 syntax
- All promises are now native (or polyfilled) ES2015 Promises
instead of jQuery's Deferred. [jcbrand]
- #866 Add babel in order to support ES2015 syntax [jcbrand]
## 3.1.0 (2017-07-05)
......
This diff is collapsed.
......@@ -144,7 +144,7 @@
var room_jid = 'kitchen@conference.shakespeare.lit';
test_utils.openAndEnterChatRoom(
_converse, 'kitchen', 'conference.shakespeare.lit', 'fires');
_converse, 'kitchen', 'conference.shakespeare.lit', 'fires').then(function () {
var view = _converse.chatboxviews.get(room_jid);
view.model.set({'minimized': true});
......@@ -162,6 +162,7 @@
expect(_converse.minimized_chats.toggleview.$('.unread-message-count').is(':visible')).toBeTruthy();
expect(_converse.minimized_chats.toggleview.$('.unread-message-count').text()).toBe('1');
done();
});
}));
});
}));
......@@ -43,7 +43,7 @@
function (done, _converse) {
test_utils.createContacts(_converse, 'current');
test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy');
test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy').then(function () {
var view = _converse.chatboxviews.get('lounge@localhost');
if (!view.$el.find('.chat-area').length) { view.renderChatArea(); }
var no_notification = false;
......@@ -73,6 +73,7 @@
delete window.Notification;
}
done();
});
}));
it("is shown for headline messages",
......@@ -158,7 +159,7 @@
function (done, _converse) {
test_utils.createContacts(_converse, 'current');
test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy');
test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy').then(function () {
_converse.play_sounds = true;
spyOn(_converse, 'playSoundNotification');
var view = _converse.chatboxviews.get('lounge@localhost');
......@@ -195,6 +196,7 @@
expect(_converse.playSoundNotification, 1);
_converse.play_sounds = false;
done();
});
}));
});
});
......
......@@ -94,10 +94,10 @@
.then(function () {
var room_jid = 'kitchen@conference.shakespeare.lit';
test_utils.openAndEnterChatRoom(
_converse, 'kitchen', 'conference.shakespeare.lit', 'romeo');
_converse, 'kitchen', 'conference.shakespeare.lit', 'romeo').then(function () {
var view = _converse.chatboxviews.get(room_jid);
view.model.set({'minimized': true});
var contact_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@localhost';
var nick = mock.chatroom_names[0];
view.handleMUCMessage(
......@@ -145,6 +145,7 @@
expect(_.includes(room_el.classList, 'unread-msgs')).toBeFalsy();
done();
});
});
}));
});
}));
This diff is collapsed.
......@@ -86,13 +86,13 @@
this.openRoomsPanel(_converse);
var roomspanel = _converse.chatboxviews.get('controlbox').roomspanel;
roomspanel.$el.find('input.new-chatroom-name').val(room);
roomspanel.$el.find('input.new-chatroom-nick').val(nick);
roomspanel.$el.find('input.new-chatroom-server').val(server);
roomspanel.$el.find('form').submit();
this.closeControlBox(_converse);
};
utils.openAndEnterChatRoom = function (converse, room, server, nick) {
return new Promise(function (resolve, reject) {
sinon.spy(converse.connection, 'sendIQ');
utils.openChatRoom(converse, room, server);
var view = converse.chatboxviews.get((room+'@'+server).toLowerCase());
......@@ -100,7 +100,7 @@
// We pretend this is a new room, so no disco info is returned.
var IQ_id = converse.connection.sendIQ.firstCall.returnValue;
var features_stanza = $iq({
from: 'lounge@localhost',
'from': 'lounge@localhost',
'id': IQ_id,
'to': 'dummy@localhost/desktop',
'type': 'error'
......@@ -108,6 +108,9 @@
.c('item-not-found', {'xmlns': "urn:ietf:params:xml:ns:xmpp-stanzas"});
converse.connection._dataRecv(utils.createRequest(features_stanza));
utils.waitUntil(function () {
return converse.connection.sendIQ.secondCall;
}).then(function () {
// The XMPP server returns the reserved nick for this user.
IQ_id = converse.connection.sendIQ.secondCall.returnValue;
var stanza = $iq({
......@@ -134,6 +137,9 @@
.c('status').attrs({code:'110'});
converse.connection._dataRecv(utils.createRequest(presence));
converse.connection.sendIQ.restore();
resolve();
});
});
};
utils.clearBrowserStorage = function () {
......
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