Move Entity#intersects test

This commit is contained in:
John Firebaugh
2013-01-18 13:12:36 -08:00
parent b27903f7b5
commit 020c56b3a2
2 changed files with 16 additions and 16 deletions
+16
View File
@@ -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);
-16
View File
@@ -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);