Skip to content

Commit

Permalink
Support disabled condition in new scheme (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlant committed Jul 29, 2023
1 parent f0c73a4 commit 536a765
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/parking/access-condition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ function mapAccessValue(tags: OsmTags, accessValue: string | undefined, side?: s
return getValue(tags, 'zone', side) ? 'residents' : 'no_stopping'

case 'no':
return getValue(tags, 'disabled', side) === 'designated' ? 'disabled' : 'no_stopping'

case 'permissive':
case 'permit':
return 'no_stopping'
Expand Down
13 changes: 13 additions & 0 deletions src/test/parking-conditions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,17 @@ describe('#getConditions()', () => {
}
expect(expectedConditions).toStrictEqual(receivedConditions)
})

test('disabled', async() => {
const tags: OsmTags = {
'parking:right:access': 'no',
'parking:right:disabled': 'designated',
}
const receivedConditions = getConditions(tags, 'right')
const expectedConditions: ParkingConditions = {
default: 'disabled',
conditionalValues: [],
}
expect(expectedConditions).toStrictEqual(receivedConditions)
})
})

0 comments on commit 536a765

Please sign in to comment.