mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-24 09:04:02 +02:00
Cache geometry
This commit is contained in:
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user