Fix failing tests.

This commit is contained in:
JC Brand 2017-01-31 21:21:59 +00:00
parent 9510bdc152
commit 0cf9903726
3 changed files with 30 additions and 29 deletions

View File

@ -303,7 +303,7 @@
close: function (ev) {
if (ev && ev.preventDefault) { ev.preventDefault(); }
if (converse.connection.connected) {
if (converse.connection.connected && !converse.connection.disconnecting) {
this.model.save({'closed': true});
} else {
this.model.trigger('hide');

View File

@ -140,6 +140,7 @@
// out or disconnecting in the previous session.
// This happens in tests.
// We therefore first clean up.
converse.connection.reset();
converse._tearDown();
}
@ -541,11 +542,11 @@
};
this.logOut = function () {
converse.chatboxviews.closeAllChatBoxes();
converse.setDisconnectionCause(converse.LOGOUT, undefined, true);
if (typeof converse.connection !== 'undefined') {
converse.connection.disconnect();
}
converse.chatboxviews.closeAllChatBoxes();
converse.clearSession();
converse._tearDown();
converse.emit('logout');