mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-21 07:46:58 +02:00
fix unsolvable validator error for presets with locationSet
This commit is contained in:
@@ -4,6 +4,17 @@ describe('iD.validations.mismatched_geometry', function () {
|
||||
beforeEach(function() {
|
||||
_savedAreaKeys = iD.osmAreaKeys;
|
||||
context = iD.coreContext().init();
|
||||
iD.fileFetcher.cache().preset_presets = {
|
||||
library: {
|
||||
tags: { amenity: 'library' },
|
||||
geometry: ['point', 'vertex', 'line', 'area'],
|
||||
locationSet: { include: ['NU'] }
|
||||
},
|
||||
generic_amenity: {
|
||||
tags: { amenity: '*' },
|
||||
geometry: ['point', 'vertex', 'line', 'area']
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
@@ -112,4 +123,11 @@ describe('iD.validations.mismatched_geometry', function () {
|
||||
expect(issue.entityIds[0]).to.eql('w-1');
|
||||
});
|
||||
|
||||
it('does not error if the best preset is limited to certain regions', async () => {
|
||||
await iD.presetManager.ensureLoaded(true);
|
||||
|
||||
createClosedWay({ amenity: 'library' });
|
||||
const issues = validate();
|
||||
expect(issues).to.have.lengthOf(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user