mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-25 09:34:04 +02:00
Add test for nonnumeric layer tag (see #3405)
This commit is contained in:
@@ -206,6 +206,12 @@ describe('iD.Way', function() {
|
||||
expect(iD.Way().layer()).to.equal(0);
|
||||
});
|
||||
|
||||
it('returns 0 when the way has a non numeric layer tag', function() {
|
||||
expect(iD.Way({tags: { layer: 'NaN' }}).layer()).to.equal(0);
|
||||
expect(iD.Way({tags: { layer: 'Infinity' }}).layer()).to.equal(0);
|
||||
expect(iD.Way({tags: { layer: 'Foo' }}).layer()).to.equal(0);
|
||||
});
|
||||
|
||||
it('returns the layer when the way has an explicit layer tag', function() {
|
||||
expect(iD.Way({tags: { layer: '2' }}).layer()).to.equal(2);
|
||||
expect(iD.Way({tags: { layer: '-5' }}).layer()).to.equal(-5);
|
||||
|
||||
Reference in New Issue
Block a user