mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-25 09:34:04 +02:00
Add area=yes when necessary
Example: highway=pedestrian areas. Fixes #2069
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user