Skip to content

Commit

Permalink
URL: Test space encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Nov 6, 2018
1 parent 50b5c18 commit ddf6f11
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 @@ -78,6 +78,13 @@ describe( 'addQueryArgs', () => {

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

it( 'should encodes spaces by RFC 3986', () => {
const url = 'https://andalouses.example/beach';
const args = { activity: 'fun in the sun' };

expect( addQueryArgs( url, args ) ).toBe( 'https://andalouses.example/beach?activity=fun%20in%20the%20sun' );
} );
} );

describe( 'getQueryArg', () => {
Expand Down

0 comments on commit ddf6f11

Please sign in to comment.