Skip to content

Commit

Permalink
Add unit test f. toQueryString function in UrlUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismayer committed Nov 13, 2023
1 parent e5f69df commit 600231e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/unit/specs/util/Url.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,20 @@ describe('UrlUtil', () => {
const paramVal = UrlUtil.getQueryParam('foo');
expect(paramVal).to.equal(undefined);
});

it('toQueryString returns correct query string', () => {
const params = {
foo: 'bar',
kalle: 0,
ralle: 8.88,
bully: true,
nullinger: null,
obj: {
sub1: 1
}
};
const queryString = UrlUtil.toQueryString(params);
console.log(queryString);
expect(queryString).to.eql('foo=bar&kalle=0&ralle=8.88&bully=true&sub1=1');
});
});

0 comments on commit 600231e

Please sign in to comment.