From e0020c37e2d449d9078b538cda518bcc5a11ff95 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 24 Oct 2014 10:34:39 -0700 Subject: [PATCH] Add test for #2421 --- test/spec/core/tree.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/spec/core/tree.js b/test/spec/core/tree.js index a776ab67c..e7b66abfc 100644 --- a/test/spec/core/tree.js +++ b/test/spec/core/tree.js @@ -117,6 +117,20 @@ describe("iD.Tree", function() { expect(tree.intersects(extent, graph)).to.eql([]); }); + it("adjusts parent relations when a member node is moved", function() { + var graph = iD.Graph(), + tree = iD.Tree(graph), + node = iD.Node({id: 'n', loc: [1, 1]}), + relation = iD.Relation({members: [{type: 'node', id: 'n'}]}), + extent = iD.geo.Extent([0, 0], [2, 2]); + + graph = graph.replace(node).replace(relation); + expect(tree.intersects(extent, graph)).to.eql([node, relation]); + + graph = graph.replace(node.move([3, 3])); + expect(tree.intersects(extent, graph)).to.eql([]); + }); + it("adjusts parent ways when a member node is removed", function() { var graph = iD.Graph(), tree = iD.Tree(graph),