diff --git a/test/spec/graph/entity.js b/test/spec/graph/entity.js index e5741104f..3f3a701fe 100644 --- a/test/spec/graph/entity.js +++ b/test/spec/graph/entity.js @@ -113,6 +113,22 @@ describe('iD.Entity', function () { }); }); + describe("#intersects", function () { + it("returns true for a way with a node within the given extent", function () { + var node = iD.Node({loc: [0, 0]}), + way = iD.Way({nodes: [node.id]}), + graph = iD.Graph([node, way]); + expect(way.intersects([[-5, -5], [5, 5]], graph)).to.equal(true); + }); + + it("returns false for way with no nodes within the given extent", function () { + var node = iD.Node({loc: [6, 6]}), + way = iD.Way({nodes: [node.id]}), + graph = iD.Graph([node, way]); + expect(way.intersects([[-5, -5], [5, 5]], graph)).to.equal(false); + }); + }); + describe("#hasInterestingTags", function () { it("returns false if the entity has no tags", function () { expect(iD.Entity().hasInterestingTags()).to.equal(false); diff --git a/test/spec/graph/way.js b/test/spec/graph/way.js index 19a4514db..c3773f6b0 100644 --- a/test/spec/graph/way.js +++ b/test/spec/graph/way.js @@ -45,22 +45,6 @@ describe('iD.Way', function() { }); }); - describe("#intersects", function () { - it("returns true for a way with a node within the given extent", function () { - var node = iD.Node({loc: [0, 0]}), - way = iD.Way({nodes: [node.id]}), - graph = iD.Graph([node, way]); - expect(way.intersects([[-5, -5], [5, 5]], graph)).to.equal(true); - }); - - it("returns false for way with no nodes within the given extent", function () { - var node = iD.Node({loc: [6, 6]}), - way = iD.Way({nodes: [node.id]}), - graph = iD.Graph([node, way]); - expect(way.intersects([[-5, -5], [5, 5]], graph)).to.equal(false); - }); - }); - describe('#isClosed', function() { it('returns false when the way has no nodes', function() { expect(iD.Way().isClosed()).to.equal(false);