Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2018-01-09 14:52:48 +01:00
commit f431bce2dc
3 changed files with 29 additions and 24 deletions

View File

@ -1,5 +1,5 @@
define("transcripts", [ define("transcripts", [
"tpl!converse-logs/double_logins", "tpl!../../converse-logs/missing_messages",
], function () { ], function () {
return arguments; return arguments;
}); });

View File

@ -1,14 +1,15 @@
(function (root, factory) { (function (root, factory) {
define([ define([
"jquery", "jquery",
"jasmine",
"converse-core", "converse-core",
"mock", "mock",
"test_utils", "test-utils",
"utils", "utils",
"transcripts" "transcripts"
], factory ], factory
); );
} (this, function ($, converse, mock, test_utils, utils, transcripts) { } (this, function ($, jasmine, converse, mock, test_utils, utils, transcripts) {
var Strophe = converse.env.Strophe; var Strophe = converse.env.Strophe;
var _ = converse.env._; var _ = converse.env._;
var IGNORED_TAGS = [ var IGNORED_TAGS = [
@ -48,28 +49,32 @@
return describe("Transcripts of chat logs", function () { return describe("Transcripts of chat logs", function () {
it("can be used to replay conversations", mock.initConverse(function (_converse) { it("can be used to replay conversations",
/* mock.initConverseWithPromises(
test_utils.openAndEnterChatRoom(_converse, "dummy", 'rooms.localhost', 'jc'); null, ['rosterGroupsFetched'], {},
test_utils.openAndEnterChatRoom(_converse, "prosody", 'conference.prosody.im', 'jc'); function (done, _converse) {
*/
test_utils.openAndEnterChatRoom(_converse, "discuss", 'conference.conversejs.org', 'jc'); _converse.allow_non_roster_messaging = true;
spyOn(_converse, 'areDesktopNotificationsEnabled').andReturn(true);
_.each(transcripts, function (transcript) { test_utils.openAndEnterChatRoom(_converse, 'discuss', 'conference.conversejs.org', 'dummy').then(function () {
var text = transcript(); spyOn(_converse, 'areDesktopNotificationsEnabled').and.returnValue(true);
var xml = Strophe.xmlHtmlNode(text); _.each(transcripts, function (transcript) {
$(xml).children('log').children('body').each(function (i, el) { var text = transcript();
$(el).children().each(function (i, el) { var xml = Strophe.xmlHtmlNode(text);
if (el.nodeType === 3) { _.each(xml.firstElementChild.children, function (el) {
return; // Ignore text _.each(el.children, function (el) {
} if (el.nodeType === 3) {
if (_.includes(IGNORED_TAGS, el.nodeName.toLowerCase())) { return; // Ignore text
return; }
} if (_.includes(IGNORED_TAGS, el.nodeName.toLowerCase())) {
var _stanza = traverseElement(el); return;
_converse.connection._dataRecv(test_utils.createRequest(_stanza)); }
var _stanza = traverseElement(el);
_converse.connection._dataRecv(test_utils.createRequest(_stanza));
});
}); });
}); });
done();
}); });
})); }));
}); });

View File

@ -30,8 +30,8 @@ config.shim.jasmine = {
require.config(config); require.config(config);
var specs = [ var specs = [
//"spec/transcripts",
"jasmine", "jasmine",
//"spec/transcripts",
"spec/profiling", "spec/profiling",
"spec/utils", "spec/utils",
"spec/converse", "spec/converse",