|
@@ -23,7 +23,8 @@
|
|
test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, [], []).then(function () {
|
|
test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, [], []).then(function () {
|
|
test_utils.waitUntil(function () {
|
|
test_utils.waitUntil(function () {
|
|
return _.filter(IQ_stanzas, function (iq) {
|
|
return _.filter(IQ_stanzas, function (iq) {
|
|
- return iq.nodeTree.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]');
|
|
|
|
|
|
+ return iq.nodeTree.querySelector(
|
|
|
|
+ 'iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]');
|
|
}).length > 0;
|
|
}).length > 0;
|
|
}, 300).then(function () {
|
|
}, 300).then(function () {
|
|
/* <iq type='result'
|
|
/* <iq type='result'
|
|
@@ -40,7 +41,8 @@
|
|
* </iq>
|
|
* </iq>
|
|
*/
|
|
*/
|
|
var stanza = _.filter(IQ_stanzas, function (iq) {
|
|
var stanza = _.filter(IQ_stanzas, function (iq) {
|
|
- return iq.nodeTree.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]');
|
|
|
|
|
|
+ return iq.nodeTree.querySelector(
|
|
|
|
+ 'iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]');
|
|
})[0];
|
|
})[0];
|
|
var info_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)];
|
|
var info_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)];
|
|
|
|
|
|
@@ -174,10 +176,26 @@
|
|
describe("A file upload toolbar button", function () {
|
|
describe("A file upload toolbar button", function () {
|
|
|
|
|
|
it("appears in private chats", mock.initConverseWithAsync(function (done, _converse) {
|
|
it("appears in private chats", mock.initConverseWithAsync(function (done, _converse) {
|
|
- test_utils.createContacts(_converse, 'current');
|
|
|
|
- var contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost';
|
|
|
|
- test_utils.openChatBoxFor(_converse, contact_jid);
|
|
|
|
- done();
|
|
|
|
|
|
+ test_utils.waitUntilDiscoConfirmed(
|
|
|
|
+ _converse, _converse.domain,
|
|
|
|
+ [{'category': 'server', 'type':'IM'}],
|
|
|
|
+ ['http://jabber.org/protocol/disco#items'], [], 'info').then(function () {
|
|
|
|
+
|
|
|
|
+ test_utils.waitUntilDiscoConfirmed(_converse, _converse.domain, [], [], ['upload.localhost'], 'items').then(function () {
|
|
|
|
+ test_utils.waitUntilDiscoConfirmed(_converse, 'upload.localhost', [], [Strophe.NS.HTTPUPLOAD], []).then(function () {
|
|
|
|
+ test_utils.createContacts(_converse, 'current');
|
|
|
|
+ var contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost';
|
|
|
|
+ test_utils.openChatBoxFor(_converse, contact_jid);
|
|
|
|
+ var view = _converse.chatboxviews.get(contact_jid);
|
|
|
|
+ test_utils.waitUntil(function () {
|
|
|
|
+ return view.el.querySelector('.upload-file');
|
|
|
|
+ }, 150).then(function () {
|
|
|
|
+ expect(view.el.querySelector('.chat-toolbar .upload-file')).not.toBe(null);
|
|
|
|
+ done();
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
}));
|
|
}));
|
|
|
|
|
|
it("appears in MUC chats", mock.initConverseWithAsync(function (done, _converse) {
|
|
it("appears in MUC chats", mock.initConverseWithAsync(function (done, _converse) {
|