Skip to content

Commit

Permalink
Merge pull request #33 from schlessera/as/add-query-args-update-test
Browse files Browse the repository at this point in the history
Add test for making sure `addQueryArgs` updates existing arguments.
  • Loading branch information
omarreiss authored Aug 15, 2017
2 parents 0ae3bd3 + ac44be3 commit e2cc1c4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/url/src/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ describe( 'addQueryArgs', () => {

expect( addQueryArgs( url, args ) ).toBe( 'https://andalouses.com/beach?night=false&sun=true&sand=false' );
} );

test( 'should update args to an URL with conflicting query string', () => {
const url = 'https://andalouses.com/beach?night=false&sun=false&sand=true';
const args = { sun: 'true', sand: 'false' };

expect( addQueryArgs( url, args ) ).toBe( 'https://andalouses.com/beach?night=false&sun=true&sand=false' );
} );
} );

0 comments on commit e2cc1c4

Please sign in to comment.