mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-27 02:12:24 +02:00
refactor isOneWay to properly support bidirectional ways (#10730)
This commit is contained in:
@@ -305,7 +305,6 @@ describe('iD.osmWay', function() {
|
||||
|
||||
it('returns true when the way has tag oneway=yes', function() {
|
||||
expect(iD.osmWay({tags: { oneway: 'yes' }}).isOneWay(), 'oneway yes').to.be.true;
|
||||
expect(iD.osmWay({tags: { oneway: '1' }}).isOneWay(), 'oneway 1').to.be.true;
|
||||
expect(iD.osmWay({tags: { oneway: '-1' }}).isOneWay(), 'oneway -1').to.be.true;
|
||||
});
|
||||
|
||||
|
||||
@@ -7,3 +7,16 @@ describe('iD.utilObjectOmit', function() {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('iD.utilCheckTagDictionary', () => {
|
||||
it('can search a standard tag-dictionary', () => {
|
||||
expect(iD.utilCheckTagDictionary({}, iD.osmPavedTags)).toBeUndefined();
|
||||
expect(iD.utilCheckTagDictionary({ surface: 'asphalt' }, iD.osmPavedTags)).toBe(true);
|
||||
});
|
||||
|
||||
it('works for falsy values', () => {
|
||||
const dictionary = { surface: { paved: 0 } };
|
||||
expect(iD.utilCheckTagDictionary({}, dictionary)).toBeUndefined();
|
||||
expect(iD.utilCheckTagDictionary({ surface: 'paved' }, dictionary)).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user