@@ -192,6 +192,7 @@ describe('Utils', () => {
192192 expect ( spy . mock . calls [ 0 ] [ 0 ] ) . toMatch (
193193 / S t o r e d o e s n o t h a v e a v a l i d r e d u c e r /
194194 )
195+
195196 spy . mockClear ( )
196197 console . error = preSpy
197198 } )
@@ -265,13 +266,16 @@ describe('Utils', () => {
265266 const bar = ( state = { bar : 2 } ) => state
266267
267268 expect ( spy . mock . calls . length ) . toBe ( 0 )
269+
268270 const reducer = combineReducers ( { foo, bar } )
269271 const state = { foo : 1 , bar : 2 , qux : 3 }
272+
270273 reducer ( state , { } )
271274 reducer ( state , { } )
272275 reducer ( state , { } )
273276 reducer ( state , { } )
274277 expect ( spy . mock . calls . length ) . toBe ( 1 )
278+
275279 reducer ( { ...state , baz : 5 } , { } )
276280 reducer ( { ...state , baz : 5 } , { } )
277281 reducer ( { ...state , baz : 5 } , { } )
@@ -290,10 +294,14 @@ describe('Utils', () => {
290294 it ( 'should return an updated state when additional reducers are passed to combineReducers' , function ( ) {
291295 const originalCompositeReducer = combineReducers ( { foo } )
292296 const store = createStore ( originalCompositeReducer )
297+
293298 store . dispatch ( ACTION )
299+
294300 const initialState = store . getState ( )
301+
295302 store . replaceReducer ( combineReducers ( { foo, bar } ) )
296303 store . dispatch ( ACTION )
304+
297305 const nextState = store . getState ( )
298306 expect ( nextState ) . not . toBe ( initialState )
299307 } )
@@ -303,31 +311,43 @@ describe('Utils', () => {
303311
304312 const originalCompositeReducer = combineReducers ( { foo, bar } )
305313 const store = createStore ( originalCompositeReducer )
314+
306315 store . dispatch ( ACTION )
316+
307317 const initialState = store . getState ( )
318+
308319 store . replaceReducer ( combineReducers ( { baz, bar } ) )
309320 store . dispatch ( ACTION )
321+
310322 const nextState = store . getState ( )
311323 expect ( nextState ) . not . toBe ( initialState )
312324 } )
313325
314326 it ( 'should return the same state when reducers passed to combineReducers not changed' , function ( ) {
315327 const originalCompositeReducer = combineReducers ( { foo, bar } )
316328 const store = createStore ( originalCompositeReducer )
329+
317330 store . dispatch ( ACTION )
331+
318332 const initialState = store . getState ( )
333+
319334 store . replaceReducer ( combineReducers ( { foo, bar } ) )
320335 store . dispatch ( ACTION )
336+
321337 const nextState = store . getState ( )
322338 expect ( nextState ) . toBe ( initialState )
323339 } )
324340
325341 it ( 'should return an updated state when one of more reducers passed to the combineReducers are removed' , function ( ) {
326342 const originalCompositeReducer = combineReducers ( { foo, bar } )
327343 const store = createStore ( originalCompositeReducer )
344+
328345 store . dispatch ( ACTION )
346+
329347 const initialState = store . getState ( )
348+
330349 store . replaceReducer ( combineReducers ( { bar } ) )
350+
331351 const nextState = store . getState ( )
332352 expect ( nextState ) . not . toBe ( initialState )
333353 } )
0 commit comments