Add area=yes when necessary

Example: highway=pedestrian areas.

Fixes #2069
This commit is contained in:
John Firebaugh
2014-01-03 12:46:50 -08:00
parent 5f8c02fddc
commit d381812f96
2 changed files with 23 additions and 2 deletions
+13 -1
View File
@@ -61,7 +61,7 @@ describe('iD.presets.Preset', function() {
describe('#applyTags', function() {
it("adds match tags", function() {
var preset = iD.presets.Preset('test', {tags: {highway: 'residential'}});
expect(preset.applyTags({}, 'area')).to.eql({highway: 'residential'});
expect(preset.applyTags({}, 'line')).to.eql({highway: 'residential'});
});
it("adds wildcard tags with value 'yes'", function() {
@@ -85,6 +85,18 @@ describe('iD.presets.Preset', function() {
preset = iD.presets.Preset('test', {fields: ['field']}, {field: field});
expect(preset.applyTags({}, 'point')).to.eql({});
});
context("with an area preset whose primary tag is not in areaKeys", function() {
var preset = iD.presets.Preset('test', {geometry: ['line', 'area'], tags: {highway: 'pedestrian'}});
it("adds no area=yes to non-areas", function() {
expect(preset.applyTags({}, 'line')).to.eql({highway: 'pedestrian'});
});
it("adds area=yes to areas", function() {
expect(preset.applyTags({}, 'area')).to.eql({highway: 'pedestrian', area: 'yes'});
});
});
});
describe('#removeTags', function() {