Commit f283f6bc authored by JC Brand's avatar JC Brand

Fix failing tests after introducing AMD version of Strophe

parent 5a253e32
......@@ -23,6 +23,7 @@
var $iq = dependencies.$iq;
var $msg = dependencies.$msg;
var $pres = dependencies.$pres;
var $build = dependencies.$build;
var DSA = dependencies.otr ? dependencies.otr.DSA : undefined;
var OTR = dependencies.otr ? dependencies.otr.OTR : undefined;
var Strophe = dependencies.Strophe;
......@@ -5280,7 +5281,12 @@
'env': {
'jQuery': $,
'Strophe': Strophe, // TODO: this must be wrapped
'_': _
'$build': $build,
'$iq': $iq,
'$pres': $pres,
'$msg': $msg,
'_': _,
'b64_sha1': b64_sha1
},
// Deprecated API methods
......
......@@ -8,6 +8,9 @@
}
);
} (this, function ($, mock, test_utils) {
var $msg = converse_api.env.$msg;
var Strophe = converse_api.env.Strophe;
return describe("Chatboxes", $.proxy(function(mock, test_utils) {
describe("A Chatbox", $.proxy(function () {
beforeEach(function () {
......
......@@ -8,6 +8,9 @@
}
);
} (this, function ($, mock, test_utils) {
var $pres = converse_api.env.$pres;
var $msg = converse_api.env.$msg;
return describe("ChatRooms", $.proxy(function (mock, test_utils) {
describe("A Chat Room", $.proxy(function () {
beforeEach(function () {
......
......@@ -8,6 +8,8 @@
}
);
} (this, function ($, mock, test_utils) {
var $pres = converse_api.env.$pres;
var $iq = converse_api.env.$iq;
var checkHeaderToggling = function ($header) {
var $toggle = $header.find('a.group-toggle');
......
......@@ -8,8 +8,9 @@
}
);
} (this, function ($, mock, test_utils) {
return describe("Converse", $.proxy(function(mock, test_utils) {
var b64_sha1 = converse_api.env.b64_sha1;
return describe("Converse", $.proxy(function(mock, test_utils) {
describe("The \"tokens\" API", $.proxy(function () {
beforeEach($.proxy(function () {
test_utils.closeAllChatBoxes();
......
......@@ -8,6 +8,8 @@
}
);
} (this, function ($, mock, test_utils) {
var $msg = converse_api.env.$msg;
return describe("The Minimized Chats Widget", $.proxy(function(mock, test_utils) {
beforeEach(function () {
runs(function () {
......
......@@ -8,6 +8,8 @@
}
);
} (this, function ($, mock, test_utils) {
var b64_sha1 = converse_api.env.b64_sha1;
return describe("The OTR module", $.proxy(function(mock, test_utils) {
beforeEach($.proxy(function () {
......
......@@ -8,6 +8,8 @@
}
);
} (this, function ($, mock, test_utils) {
var Strophe = converse_api.env.Strophe;
describe("Profiling", function() {
beforeEach(function() {
converse.connection.roster.items = [];
......
......@@ -8,6 +8,8 @@
}
);
} (this, function ($, mock, test_utils) {
var Strophe = converse_api.env.Strophe;
var $iq = converse_api.env.$iq;
describe("The Registration Panel", $.proxy(function (mock, test_utils) {
beforeEach(function () {
......
(function (root, factory) {
define("mock",
['converse'],
function() {
return factory();
function(converse) {
return factory(converse);
});
}(this, function (converse) {
var Strophe = converse.env.Strophe;
var $iq = converse.env.$iq;
var mock = {};
// Names from http://www.fakenamegenerator.com/
mock.req_names = [
......@@ -64,54 +66,5 @@
c.attach(c.jid);
return c;
}();
/*
{
'muc': {
'listRooms': function () {},
'join': function () {},
'leave': function () {},
'rooms': {},
'groupchat': function () {return String((new Date()).getTime()); }
},
'service': 'jasmine tests',
'addHandler': function (handler, ns, name, type, id, from, options) {
return function () {};
},
'send': function () {},
'roster': {
'add': function () {},
'authorize': function () {},
'unauthorize': function () {},
'get': function () {},
'subscribe': function () {},
'registerCallback': function () {},
'remove': function (jid, callback) { callback(); }
},
'vcard': {
'get': function (callback, jid) {
var fullname;
if (!jid) {
jid = 'dummy@localhost';
fullname = 'Max Mustermann' ;
} else {
var name = jid.split('@')[0].replace(/\./g, ' ').split(' ');
var last = name.length-1;
name[0] = name[0].charAt(0).toUpperCase()+name[0].slice(1);
name[last] = name[last].charAt(0).toUpperCase()+name[last].slice(1);
fullname = name.join(' ');
}
var vcard = $iq().c('vCard').c('FN').t(fullname);
callback(vcard.tree());
}
},
'disco': {
'addFeature': function () {},
'addIdentity': function () {},
'info': function () {},
'items': function () {}
}
};
*/
return mock;
}));
......@@ -7,6 +7,7 @@
return factory($, mock);
});
}(this, function ($, mock) {
var Strophe = converse_api.env.Strophe;
var utils = {};
utils.createRequest = function (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