Commit fc941270 authored by JC Brand's avatar JC Brand

Fix failing tests

parent 393bbe02
This diff is collapsed.
......@@ -546,8 +546,16 @@
null, ['rosterGroupsFetched'], {},
function (done, _converse) {
test_utils.createContacts(_converse, 'current');
test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy').then(function () {
test_utils.waitUntilFeatureSupportConfirmed(_converse, 'vcard-temp')
.then(function () {
return test_utils.waitUntil(function () {
return _converse.xmppstatus.get('fullname');
}, 300);
}).then(function () {
test_utils.createContacts(_converse, 'current');
return 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 message = '/me is tired';
......
This diff is collapsed.
......@@ -11,7 +11,27 @@
if (typeof window.Promise === 'undefined') {
waitUntilPromise.setPromiseImplementation(Promise);
}
utils.waitUntil = waitUntilPromise['default'];
utils.waitUntil = waitUntilPromise.default;
utils.waitUntilFeatureSupportConfirmed = function (_converse, feature_name) {
var IQ_disco, stanza;
return utils.waitUntil(function () {
IQ_disco = _.filter(_converse.connection.IQ_stanzas, function (iq) {
return iq.nodeTree.querySelector('query[xmlns="http://jabber.org/protocol/disco#info"]');
}).pop();
return !_.isUndefined(IQ_disco);
}, 300).then(function () {
var info_IQ_id = IQ_disco.nodeTree.getAttribute('id');
stanza = $iq({
'type': 'result',
'from': 'localhost',
'to': 'dummy@localhost/resource',
'id': info_IQ_id
}).c('query', {'xmlns': 'http://jabber.org/protocol/disco#info'})
.c('feature', {'var': feature_name});
_converse.connection._dataRecv(utils.createRequest(stanza));
});
}
utils.createRequest = function (iq) {
iq = typeof iq.tree == "function" ? iq.tree() : iq;
......
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