Add test unit for null|undefined params in ol.uri
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user