Cache geometry

This commit is contained in:
John Firebaugh
2013-05-17 14:31:36 -07:00
parent 6b511ff45a
commit 2e4207f99b
7 changed files with 21 additions and 11 deletions
+6 -2
View File
@@ -47,8 +47,12 @@ describe('iD.Relation', function () {
});
describe("#geometry", function () {
it("returns 'relation'", function () {
expect(iD.Relation().geometry()).to.equal('relation');
it("returns 'area' for multipolygons", function () {
expect(iD.Relation({tags: {type: 'multipolygon'}}).geometry(iD.Graph())).to.equal('area');
});
it("returns 'relation' for other relations", function () {
expect(iD.Relation().geometry(iD.Graph())).to.equal('relation');
});
});
+2 -2
View File
@@ -176,11 +176,11 @@ describe('iD.Way', function() {
describe("#geometry", function() {
it("returns 'line' when the way is not an area", function () {
expect(iD.Way().geometry()).to.equal('line');
expect(iD.Way().geometry(iD.Graph())).to.equal('line');
});
it("returns 'area' when the way is an area", function () {
expect(iD.Way({tags: { area: 'yes' }}).geometry()).to.equal('area');
expect(iD.Way({tags: { area: 'yes' }}).geometry(iD.Graph())).to.equal('area');
});
});