Commit 2711b231 authored by Sven Franck's avatar Sven Franck

Revision-Local-Storage: add test to check for solved conflicts

parent b69dfc1b
...@@ -181,7 +181,8 @@ jIO.addStorageType('revision', function (spec, my) { ...@@ -181,7 +181,8 @@ jIO.addStorageType('revision', function (spec, my) {
"status":document_tree.status "status":document_tree.status
}); });
} }
if (document_tree.children.length === 0) { if (document_tree.children.length === 0 &&
document_tree.status !== "deleted" ) {
// This node is a leaf // This node is a leaf
if (result.length < deep) { if (result.length < deep) {
// The leaf is deeper than result // The leaf is deeper than result
...@@ -298,7 +299,8 @@ jIO.addStorageType('revision', function (spec, my) { ...@@ -298,7 +299,8 @@ jIO.addStorageType('revision', function (spec, my) {
if (except !== undefined && except === document_tree.rev) { if (except !== undefined && except === document_tree.rev) {
return; return;
} }
if (document_tree.children.length === 0) { if (document_tree.children.length === 0 &&
document_tree.status !== "deleted") {
// This node is a leaf // This node is a leaf
result.push(document_tree.rev); result.push(document_tree.rev);
return; return;
......
...@@ -1678,6 +1678,19 @@ test ("Scenario", function(){ ...@@ -1678,6 +1678,19 @@ test ("Scenario", function(){
o.jio.remove({"_id":"sample1", "_rev":o.rev_1}, o.f); o.jio.remove({"_id":"sample1", "_rev":o.rev_1}, o.f);
o.tick(o); o.tick(o);
// check to see if conflict still exists
o.mydocSample4 = {"_id": "sample1", "title": "mySample2_modified",
"_rev": o.rev_2};
o.mydocSample4._revs_info = [{"rev": o.rev_2, "status": "available"},{
"rev":o.rev,"status":"available"
}];
o.mydocSample4._revisions = {"ids":[o.hex_2, o.hex], "start":2 };
o.spy(o, "value", o.mydocSample4, "Test if conflict still exists");
o.jio.get("sample1", {"revs_info": true, "revs": true,
"conflicts": true,}, o.f);
o.tick(o);
// END // END
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