Skip to content

Commit

Permalink
Framework: Move locale param expectations inline
Browse files Browse the repository at this point in the history
Without freeze, can’t be certain that the original instance wasn’t
modified
  • Loading branch information
aduth committed Feb 16, 2016
1 parent 28d1feb commit 4004c18
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions client/lib/wp/localization/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,16 @@ describe( 'localization', () => {

describe( '#addLocaleQueryParam()', () => {
it( 'should not modify params if locale unknown', () => {
const original = { query: 'search=foo' };
const params = addLocaleQueryParam( original );
const params = addLocaleQueryParam( { query: 'search=foo' } );

expect( params ).to.eql( original );
expect( params ).to.eql( { query: 'search=foo' } );
} );

it( 'should not modify params if locale is default', () => {
localization.__set__( 'locale', 'en' );
const original = { query: 'search=foo' };
const params = addLocaleQueryParam( original );
const params = addLocaleQueryParam( { query: 'search=foo' } );

expect( params ).to.eql( original );
expect( params ).to.eql( { query: 'search=foo' } );
} );

it( 'should include the locale query parameter for a non-default locale', () => {
Expand Down

0 comments on commit 4004c18

Please sign in to comment.