Add test unit for null|undefined params in ol.uri

This commit is contained in:
Alexandre Dubé
2016-08-16 08:30:56 -04:00
parent 3959e9b76f
commit d61bdfb20a

View File

@@ -62,4 +62,13 @@ describe('ol.uri.appendParams()', function() {
expect(url).to.equal('http://example.com/foo?bar=bam&baz=bat&bop=&k=v');
});
it('should not append null or undefined parameters to the url', function() {
var url = ol.uri.appendParams('http://example.com/foo', {
a: '1',
b: null,
c: undefined
});
expect(url).to.equal('http://example.com/foo?a=1');
});
});