@@ -337,15 +337,15 @@ describe('ngRx Store', () => {
337
337
store . addReducer ( key , counterReducer ) ;
338
338
expect ( reducerManagerDispatcherSpy ) . toHaveBeenCalledWith ( {
339
339
type : UPDATE ,
340
- feature : key ,
340
+ features : [ key ] ,
341
341
} ) ;
342
342
} ) ;
343
343
344
344
it ( 'should dispatch an update reducers action when a reducer is removed' , ( ) => {
345
345
store . removeReducer ( key ) ;
346
346
expect ( reducerManagerDispatcherSpy ) . toHaveBeenCalledWith ( {
347
347
type : UPDATE ,
348
- feature : key ,
348
+ features : [ key ] ,
349
349
} ) ;
350
350
} ) ;
351
351
} ) ;
@@ -373,11 +373,11 @@ describe('ngRx Store', () => {
373
373
374
374
expect ( reducerManagerDispatcherSpy ) . toHaveBeenCalledWith ( {
375
375
type : UPDATE ,
376
- feature : 'feature1' ,
376
+ features : [ 'feature1' ] ,
377
377
} ) ;
378
378
} ) ;
379
379
380
- it ( 'should dispatch an update reducers action for each feature that is added' , ( ) => {
380
+ it ( 'should dispatch an update reducers action when multiple features are added' , ( ) => {
381
381
reducerManager . addFeatures ( [
382
382
createFeature ( {
383
383
key : 'feature1' ,
@@ -387,18 +387,10 @@ describe('ngRx Store', () => {
387
387
} ) ,
388
388
] ) ;
389
389
390
- expect ( reducerManagerDispatcherSpy ) . toHaveBeenCalledTimes ( 2 ) ;
391
-
392
- // get the first argument for the first call
393
- expect ( reducerManagerDispatcherSpy . calls . argsFor ( 0 ) [ 0 ] ) . toEqual ( {
394
- type : UPDATE ,
395
- feature : 'feature1' ,
396
- } ) ;
397
-
398
- // get the first argument for the second call
399
- expect ( reducerManagerDispatcherSpy . calls . argsFor ( 1 ) [ 0 ] ) . toEqual ( {
390
+ expect ( reducerManagerDispatcherSpy ) . toHaveBeenCalledTimes ( 1 ) ;
391
+ expect ( reducerManagerDispatcherSpy ) . toHaveBeenCalledWith ( {
400
392
type : UPDATE ,
401
- feature : ' feature2',
393
+ features : [ 'feature1' , ' feature2'] ,
402
394
} ) ;
403
395
} ) ;
404
396
@@ -411,11 +403,11 @@ describe('ngRx Store', () => {
411
403
412
404
expect ( reducerManagerDispatcherSpy ) . toHaveBeenCalledWith ( {
413
405
type : UPDATE ,
414
- feature : 'feature1' ,
406
+ features : [ 'feature1' ] ,
415
407
} ) ;
416
408
} ) ;
417
409
418
- it ( 'should dispatch an update reducers action for each feature that is removed' , ( ) => {
410
+ it ( 'should dispatch an update reducers action when multiple features are removed' , ( ) => {
419
411
reducerManager . removeFeatures ( [
420
412
createFeature ( {
421
413
key : 'feature1' ,
@@ -425,16 +417,10 @@ describe('ngRx Store', () => {
425
417
} ) ,
426
418
] ) ;
427
419
428
- // get the first argument for the first call
429
- expect ( reducerManagerDispatcherSpy . calls . argsFor ( 0 ) [ 0 ] ) . toEqual ( {
430
- type : UPDATE ,
431
- feature : 'feature1' ,
432
- } ) ;
433
-
434
- // get the first argument for the second call
435
- expect ( reducerManagerDispatcherSpy . calls . argsFor ( 1 ) [ 0 ] ) . toEqual ( {
420
+ expect ( reducerManagerDispatcherSpy ) . toHaveBeenCalledTimes ( 1 ) ;
421
+ expect ( reducerManagerDispatcherSpy ) . toHaveBeenCalledWith ( {
436
422
type : UPDATE ,
437
- feature : ' feature2',
423
+ features : [ 'feature1' , ' feature2'] ,
438
424
} ) ;
439
425
} ) ;
440
426
0 commit comments