From d61bdfb20a327286fb7818a37ba6697901689eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Dub=C3=A9?= Date: Tue, 16 Aug 2016 08:30:56 -0400 Subject: [PATCH] Add test unit for null|undefined params in ol.uri --- test/spec/ol/uri.test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/spec/ol/uri.test.js b/test/spec/ol/uri.test.js index 97ff5976d6..374d21ddaf 100644 --- a/test/spec/ol/uri.test.js +++ b/test/spec/ol/uri.test.js @@ -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'); + }); + });