diff --git a/test/jio.storage/localstorage.asynctests.js b/test/jio.storage/localstorage.asynctests.js index 3b1e69632e485e3137781a4f09b9c35978f7a963..7fd0bc7f72e39d230284b3236e65f93234466292 100644 --- a/test/jio.storage/localstorage.asynctests.js +++ b/test/jio.storage/localstorage.asynctests.js @@ -645,7 +645,7 @@ }); test("Check & Repair", function () { - expect(17); + expect(18); var o = {}, jio = jIO.createJIO({ "type": "local", "username": "urepair", @@ -676,14 +676,13 @@ "jio/localstorage/urepair/arepair/cor", "blue" ); - - // put an unreferenced attachment - util.json_local_storage.setItem( - "jio/localstorage/urepair/arepair/unref/aa", - "attachment content" - ); }; + // put an unreferenced attachment + util.json_local_storage.setItem( + "jio/localstorage/urepair/arepair/unref/aa", + "attachment content" + ); o.putCorruptedDocuments(); return jIO.Promise.all([ @@ -869,6 +868,13 @@ 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); });