Commit 18d9c7a6 authored by Sebastien Robin's avatar Sebastien Robin

add more assertions to check removal with localstorage

parent fef5eff6
...@@ -1026,7 +1026,7 @@ test ("Remove", function(){ ...@@ -1026,7 +1026,7 @@ test ("Remove", function(){
// check document // check document
ok(localstorage.getItem("jio/localstorage/uremove/aremove/remove1")===null, ok(localstorage.getItem("jio/localstorage/uremove/aremove/remove1")===null,
"Check documuent"); "Check document");
// adding a document + attmt // adding a document + attmt
localstorage.setItem("jio/localstorage/uremove/aremove/remove1", { localstorage.setItem("jio/localstorage/uremove/aremove/remove1", {
...@@ -1043,9 +1043,13 @@ test ("Remove", function(){ ...@@ -1043,9 +1043,13 @@ test ("Remove", function(){
"jio/localstorage/uremove/aremove/remove1/remove2", "fghi"); "jio/localstorage/uremove/aremove/remove1/remove2", "fghi");
// remove attachment // remove attachment
o.spy(o, "value", {"ok": true, "id": "remove1"}, "Remove attachment"); o.spy(o, "value", {"ok": true, "id": "remove1"}, "Remove document and attachment");
o.jio.remove({"_id": "remove1"}, o.f); o.jio.remove({"_id": "remove1"}, o.f);
o.tick(o); o.tick(o);
ok(localstorage.getItem("jio/localstorage/uremove/aremove/remove1"
)===null, "Check document is removed");
ok(localstorage.getItem("jio/localstorage/uremove/aremove/remove1/remove2"
)===null, "Check attachment is removed");
o.jio.stop(); o.jio.stop();
......
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