Add general test for spatial tree

This commit is contained in:
Ansis Brammanis
2013-02-13 15:10:48 -05:00
parent b80bbc1fbe
commit 64c8ef626f
2 changed files with 9 additions and 2 deletions
+7
View File
@@ -44,5 +44,12 @@ describe("iD.Tree", function() {
tree.rebase(['n']);
expect(tree.intersects(iD.geo.Extent([0, 0], [1, 1]), g)).to.eql([way, node]);
});
it("includes entities within extent, excludes those without", function() {
var n1 = iD.Node({ id: 'n1', loc: [1, 1]});
var n2 = iD.Node({ id: 'n2', loc: [3, 3]});
var g = tree.graph().replace(n1).replace(n2);
expect(tree.intersects(iD.geo.Extent([0, 0], [1.1, 1.1]), g)).to.eql([n1]);
});
});
});