Commit 0b89c735 authored by Tristan Cavelier's avatar Tristan Cavelier

jio localstorage repair tests added

parent c7f20bc8
...@@ -645,7 +645,7 @@ ...@@ -645,7 +645,7 @@
}); });
test("Check & Repair", function () { test("Check & Repair", function () {
expect(17); expect(18);
var o = {}, jio = jIO.createJIO({ var o = {}, jio = jIO.createJIO({
"type": "local", "type": "local",
"username": "urepair", "username": "urepair",
...@@ -676,14 +676,13 @@ ...@@ -676,14 +676,13 @@
"jio/localstorage/urepair/arepair/cor", "jio/localstorage/urepair/arepair/cor",
"blue" "blue"
); );
};
// put an unreferenced attachment // put an unreferenced attachment
util.json_local_storage.setItem( util.json_local_storage.setItem(
"jio/localstorage/urepair/arepair/unref/aa", "jio/localstorage/urepair/arepair/unref/aa",
"attachment content" "attachment content"
); );
};
o.putCorruptedDocuments(); o.putCorruptedDocuments();
return jIO.Promise.all([ return jIO.Promise.all([
...@@ -869,6 +868,13 @@ ...@@ -869,6 +868,13 @@
o.testGetAnswers(answers); o.testGetAnswers(answers);
}).then(function () {
// unreferenced attachment must be removed
deepEqual(util.json_local_storage.getItem(
"jio/localstorage/urepair/arepair/unref/aa"
), null, "Unreferenced attachment removed");
}).always(start); }).always(start);
}); });
......
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