Skip to content

Commit

Permalink
Fix existing JS unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
noahtallen committed Jul 14, 2020
1 parent 6953ad4 commit fa51d1a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/edit-site/src/store/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function page( state, action ) {
*
* @return {Object} Updated state.
*/
export function homeTemplateId( state = {}, action ) {
export function homeTemplateId( state, action ) {
switch ( action.type ) {
case 'SET_HOME_TEMPLATE':
return action.homeTemplateId;
Expand Down
14 changes: 1 addition & 13 deletions packages/edit-site/src/store/test/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
templatePartId,
templateType,
page,
showOnFront,
} from '../reducer';
import { PREFERENCES_DEFAULTS } from '../defaults';

Expand Down Expand Up @@ -165,7 +164,7 @@ describe( 'state', () => {

describe( 'page()', () => {
it( 'should apply default state', () => {
expect( page( undefined, {} ) ).toEqual( {} );
expect( page( undefined, {} ) ).toEqual( undefined );
} );

it( 'should default to returning the same state', () => {
Expand All @@ -183,15 +182,4 @@ describe( 'state', () => {
).toBe( newPage );
} );
} );

describe( 'showOnFront()', () => {
it( 'should apply default state', () => {
expect( showOnFront( undefined, {} ) ).toEqual( undefined );
} );

it( 'should default to returning the same state', () => {
const state = {};
expect( showOnFront( state, {} ) ).toBe( state );
} );
} );
} );
8 changes: 0 additions & 8 deletions packages/edit-site/src/store/test/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
getTemplatePartId,
getTemplateType,
getPage,
getShowOnFront,
} from '../selectors';

describe( 'selectors', () => {
Expand Down Expand Up @@ -142,11 +141,4 @@ describe( 'selectors', () => {
expect( getPage( state ) ).toBe( state.page );
} );
} );

describe( 'getShowOnFront', () => {
it( 'returns the `show_on_front` setting', () => {
const state = { showOnFront: {} };
expect( getShowOnFront( state ) ).toBe( state.showOnFront );
} );
} );
} );

0 comments on commit fa51d1a

Please sign in to comment.