@@ -8,7 +8,7 @@ describe('mutator', () => {
88let mockGlobalContext :any ;
99
1010beforeEach ( ( ) => {
11- mockGlobalContext = { inMutator : false } ;
11+ mockGlobalContext = { currentMutator : null } ;
1212spyOn ( globalContext , 'getGlobalContext' ) . and . returnValue ( mockGlobalContext ) ;
1313spyOn ( dispatcher , 'subscribe' ) ;
1414} ) ;
@@ -74,12 +74,11 @@ describe('mutator', () => {
7474expect ( subscribedCallback ) . toThrow ( ) ;
7575} ) ;
7676
77- it ( 'sets theinMutator flag totrue for the duration of the mutator callback' , ( ) => {
77+ it ( 'sets thecurrentMutator toactionMessage type for the duration of the mutator callback' , ( ) => {
7878// Arrange
79- let actionCreator :any = { __SATCHELJS_ACTION_ID :'testAction' } ;
80- let inMutatorValue ;
79+ let actionCreator :any = { __SATCHELJS_ACTION_ID :'testAction' , name :'testName' } ;
8180let callback = ( ) => {
82- expect ( mockGlobalContext . inMutator ) . toBeTruthy ( ) ;
81+ expect ( mockGlobalContext . currentMutator ) . toBe ( 'testName' ) ;
8382} ;
8483mutator ( actionCreator , callback ) ;
8584
@@ -88,6 +87,6 @@ describe('mutator', () => {
8887subscribedCallback ( ) ;
8988
9089// Assert
91- expect ( mockGlobalContext . inMutator ) . toBeFalsy ( ) ;
90+ expect ( mockGlobalContext . currentMutator ) . toBe ( null ) ;
9291} ) ;
9392} ) ;