Skip to content

Commit

Permalink
Guard against unhandled action reference change
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Jun 15, 2017
1 parent 468519d commit d0158e0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions editor/test/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,18 @@ describe( 'state', () => {
expect( store.getState ).to.be.a( 'function' );
} );

it( 'should return same state on unhandled action', () => {
// If you're here investigating why tests are failing, you should
// ensure that your reducer is not returning a new state object if
// it's not handling the action (i.e. that nothing has changed)
const store = createReduxStore();
const originalState = store.getState();

store.dispatch( { type: '__UNHANDLED' } );

expect( store.getState() ).to.equal( originalState );
} );

it( 'should have expected reducer keys', () => {
const store = createReduxStore();
const state = store.getState();
Expand Down

0 comments on commit d0158e0

Please sign in to comment.