Skip to content

Commit

Permalink
add sub state strict equal test
Browse files Browse the repository at this point in the history
  • Loading branch information
magicdawn committed Sep 6, 2017
1 parent 1130c31 commit 6e50460
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ describe('immutability-helper', function() {
})

it('it works', function() {
const oldPartial2 = state.partial2

state = reducer(state, {
type: 'UPDATE_PARTIAL_1',
standard: true,
Expand All @@ -43,6 +45,9 @@ describe('immutability-helper', function() {
})
state.partial1.foo.should.equal('updated-foo-1')

// partial2 should not change
assert(state.partial2 === oldPartial2)

// init `partial1.sub` to object
state = reducer(state, {
type: 'UPDATE_PARTIAL_1',
Expand Down

0 comments on commit 6e50460

Please sign in to comment.