add test for geojson sanitation of non-string properties

This commit is contained in:
Martin Raifer
2021-11-23 13:35:05 +01:00
parent 3373f1b53d
commit 6e6becb4e4

View File

@@ -22,7 +22,11 @@ describe('iD.svgData', function () {
' "area": 19717.8,' +
' "name": "New Jersey",' +
' "name_en": "New Jersey",' +
' "osm_id": 316973311' +
' "osm_id": 316973311,' +
' "flag": true,' +
' "list": [1,2,3],' +
' "null": null,' +
' "object": {}' +
' },' +
' "id": 316973311' +
' }' +
@@ -171,6 +175,11 @@ describe('iD.svgData', function () {
path = surface.selectAll('path.stroke');
expect(path.nodes().length).to.eql(1);
expect(path.attr('d')).to.match(/^M.*z$/);
expect(render.geojson().features[0].properties.osm_id).to.be.a('string');
expect(render.geojson().features[0].properties.flag).to.be.a('string');
expect(render.geojson().features[0].properties.list).to.be.a('string');
expect(render.geojson().features[0].properties.null).to.be.a('string');
expect(render.geojson().features[0].properties.object).to.be.a('string');
done();
}, 200);
});