display explicit "context" tags of deprecation rules, closes #10104

This commit is contained in:
Martin Raifer
2025-04-15 11:34:33 +02:00
parent d871792d94
commit 10030bb4ae
3 changed files with 41 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
import { select as d3_select } from 'd3-selection';
import { setTimeout } from 'node:timers/promises';
describe('iD.validations.outdated_tags', function () {
@@ -194,6 +195,20 @@ describe('iD.validations.outdated_tags', function () {
});
});
it('includes unchanged context tags of deprecation rule in tag reference', async () => {
createWay({ building: 'roof' });
const validator = iD.validationOutdatedTags(context);
await setTimeout(20);
const issues = validate(validator);
expect(issues).toHaveLength(1);
const selection = d3_select(document.createElement('div'));
issues[0].reference(selection);
const tagReference = selection.selectAll('table .tagDiff-row').data();
expect(tagReference).toHaveLength(2);
expect(tagReference.some(ref => ref.type === '+' && ref.key === 'layer')).toBeTruthy();
expect(tagReference.some(ref => ref.type === '~' && ref.key === 'building')).toBeTruthy();
});
it('generates 2 separate issues for incomplete tags and NSI suggestions', async () => {
createWay({ building: 'roof', amenity: 'fast_food', brand: 'Fish Bowl' });
const validator = iD.validationOutdatedTags(context);