Skip to content

Commit

Permalink
Utils: Improve undoable reducer tests to check reference equality
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Nov 3, 2017
1 parent 93ff853 commit 2e91181
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions editor/utils/test/undoable-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,12 @@ describe( 'undoableReducer', () => {
future: [],
} );
} );

it( 'should return same reference if state has not changed', () => {
const reducer = undoableReducer( counter );
const original = reducer( undefined, {} );
const state = reducer( original, {} );

expect( state ).toBe( original );
} );
} );

0 comments on commit 2e91181

Please sign in to comment.