mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
fix calculation of access field placeholder on multiselections
This commit is contained in:
@@ -112,4 +112,28 @@ describe('iD.uiFieldAccess', function() {
|
||||
expect(selection.selectAll('.preset-input-access-motor_vehicle').attr('placeholder')).to.equal('destination');
|
||||
});
|
||||
|
||||
it('sets bicycle and motor_vehicle placeholder to the value of the "vehicle" tag (id-tagging-schema#378)', function() {
|
||||
var access = iD.uiFieldAccess(field, context);
|
||||
selection.call(access);
|
||||
|
||||
access.tags({highway: 'residential', vehicle: 'destination'});
|
||||
expect(selection.selectAll('.preset-input-access-motor_vehicle').attr('placeholder')).to.equal('destination');
|
||||
expect(selection.selectAll('.preset-input-access-bicycle').attr('placeholder')).to.equal('destination');
|
||||
});
|
||||
|
||||
it('sets correct placeholder on a multi selection', function() {
|
||||
var access = iD.uiFieldAccess(field, context);
|
||||
selection.call(access);
|
||||
|
||||
var tags = {highway: 'primary', foot: ['yes', 'no'], bicycle: ['no', undefined], vehicle: ['no', undefined]};
|
||||
tags[Symbol.for('allTags')] = [
|
||||
{highway: 'primary', foot: 'yes', bicycle: 'no'},
|
||||
{highway: 'primary', foot: 'no', vehicle: 'no'}
|
||||
];
|
||||
access.tags(tags);
|
||||
expect(selection.selectAll('.preset-input-access-foot').attr('placeholder')).to.equal(iD.localizer.t('inspector.multiple_values'));
|
||||
expect(selection.selectAll('.preset-input-access-bicycle').attr('placeholder')).to.equal('no');
|
||||
expect(selection.selectAll('.preset-input-access-motor_vehicle').attr('placeholder')).to.equal(iD.localizer.t('inspector.multiple_values'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user