Fix the tests to work with the async migration

pull/1/head
yflory 8 years ago
parent a57f7c6ce7
commit d24458e4b0

@ -109,6 +109,7 @@ define([
}]
};
var fo = FO.init(files, config);
var todo = function () {
fo.fixFiles();
if (files['CryptPad_RECENTPADS'] || !files.filesData) {
console.log("DRIVE1: migration from RECENTPADS to filesData failed");
@ -127,6 +128,8 @@ define([
&& typeof files.filesData[files.template[0]] === "object"
&& !files.filesData[files.template[0]].filename;
return cb(res);
};
fo.migrate(todo);
}, "DRIVE1: migration and fixFiles without unsorted");
assert(function (cb) {
@ -153,6 +156,7 @@ define([
}]
};
var fo = FO.init(files, config);
var todo = function () {
fo.fixFiles();
if (files['CryptPad_RECENTPADS'] || !files.filesData) {
console.log("DRIVE2: migration from RECENTPADS to filesData failed");
@ -180,6 +184,8 @@ define([
&& typeof files.filesData[fileId2] === "object"
&& !files.filesData[fileId2].filename;
return cb(res);
};
fo.migrate(todo);
}, "DRIVE2: migration and fixFiles with unsorted");
assert(function (cb) {
@ -204,6 +210,7 @@ define([
"CryptPad_RECENTPADS": []
};
var fo = FO.init(files, config);
var todo = function () {
fo.fixFiles();
if (files['CryptPad_RECENTPADS'] || !files.filesData) {
console.log("DRIVE2: migration from RECENTPADS to filesData failed");
@ -231,6 +238,8 @@ define([
&& files.filesData[fileId2].filename === "Trash"
&& files.filesData[fileId2].href === href4;
return cb(res);
};
fo.migrate(todo);
}, "DRIVE4: migration and fixFiles with a pad in trash not root");
// userObject Tests

Loading…
Cancel
Save