Skip to content

Commit

Permalink
Merge pull request #34 from WordPress/update/url-domain-name
Browse files Browse the repository at this point in the history
tests: Use the generic domain `example.com` in tests
  • Loading branch information
omarreiss authored Aug 16, 2017
2 parents f30f8f9 + cb4e16c commit d7c1b5e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/url/src/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ import { addQueryArgs } from '../';

describe( 'addQueryArgs', () => {
test( 'should append args to an URL without query string', () => {
const url = 'https://andalouses.com/beach';
const url = 'https://andalouses.example/beach';
const args = { sun: 'true', sand: 'false' };

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

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

expect( addQueryArgs( url, args ) ).toBe( 'https://andalouses.com/beach?night=false&sun=true&sand=false' );
expect( addQueryArgs( url, args ) ).toBe( 'https://andalouses.example/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 url = 'https://andalouses.example/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' );
expect( addQueryArgs( url, args ) ).toBe( 'https://andalouses.example/beach?night=false&sun=true&sand=false' );
} );
} );

0 comments on commit d7c1b5e

Please sign in to comment.