Fallback Area preset should preserve the area=yes tag

(closes #4424)
This commit is contained in:
Bryan Housel
2017-10-10 20:54:41 -04:00
parent d82a34ed83
commit 8abc39461b
2 changed files with 23 additions and 17 deletions
+8 -4
View File
@@ -97,7 +97,7 @@ describe('iD.presetPreset', function() {
expect(preset.applyTags({}, 'point')).to.eql({});
});
context('for a preset with no tag in areaKeys', function() {
describe('for a preset with no tag in areaKeys', function() {
var preset = iD.presetPreset('test', {geometry: ['line', 'area'], tags: {name: 'testname', highway: 'pedestrian'}});
it('doesn\'t add area=yes to non-areas', function() {
@@ -109,11 +109,15 @@ describe('iD.presetPreset', function() {
});
});
context('for a preset with a tag in areaKeys', function() {
var preset = iD.presetPreset('test', {geometry: ['area'], tags: {name: 'testname', natural: 'water'}});
it('doesn\'t add area=yes', function() {
describe('for a preset with a tag in areaKeys', function() {
it('doesn\'t add area=yes automatically', function() {
var preset = iD.presetPreset('test', {geometry: ['area'], tags: {name: 'testname', natural: 'water'}});
expect(preset.applyTags({}, 'area')).to.eql({name: 'testname', natural: 'water'});
});
it('does add area=yes if asked to', function() {
var preset = iD.presetPreset('test', {geometry: ['area'], tags: {name: 'testname', area: 'yes'}});
expect(preset.applyTags({}, 'area')).to.eql({name: 'testname', area: 'yes'});
});
});
});