Add test for nonnumeric layer tag (see #3405)

This commit is contained in:
Bryan Housel
2016-10-01 10:33:13 -04:00
parent 04039db286
commit a74157cb71
+6
View File
@@ -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);