@@ -69,7 +69,6 @@ test('should transition between states', t => {
6969} , 'Should set initial status to "INIT"' )
7070
7171action ( 'DUMMY AGAIN' )
72-
7372t . equals ( state , prevState , 'Should not change the state when an action is unhandled' )
7473
7574action ( 'FETCH_USERS_RESPONSE' , { users} )
@@ -106,6 +105,62 @@ test('should transition between states', t => {
106105t . end ( )
107106} )
108107
108+ test ( 'should pass all arguments to inner reducers' , t => {
109+ const configReducer = ( state = { } , action ) => state ;
110+ const gameReducer = ( state = { } , action , isMuted ) => {
111+ switch ( action . type ) {
112+ case 'START' :
113+ const audio = ( isMuted === true ) ?'OFF' :'ON'
114+ return Object . assign ( { } , state , {
115+ audio :audio
116+ } )
117+ default :
118+ return state
119+ }
120+ }
121+ const innerReducer = ( state = { } , action ) => {
122+ const isMuted = state . config ?state . config . isMuted :undefined
123+ return {
124+ 'game' :gameReducer ( state . game , action , isMuted ) ,
125+ 'config' :configReducer ( state . config , action )
126+ }
127+ }
128+ const fsmReducer = createMachine ( {
129+ 'INIT' :innerReducer
130+ } ) ;
131+ const store = createStore ( fsmReducer , undefined )
132+ store . dispatch ( {
133+ type :'START'
134+ } )
135+ t . deepEquals ( store . getState ( ) , {
136+ status :'INIT' ,
137+ game :{
138+ audio :'ON'
139+ } ,
140+ config :{ }
141+ } , 'Should turn game audio "ON" if isMuted !== true' )
142+
143+ const silentStore = createStore ( fsmReducer , {
144+ config :{
145+ isMuted :true
146+ }
147+ } )
148+ silentStore . dispatch ( {
149+ type :'START'
150+ } )
151+ t . deepEquals ( silentStore . getState ( ) , {
152+ status :'INIT' ,
153+ game :{
154+ audio :'OFF'
155+ } ,
156+ config :{
157+ isMuted :true
158+ }
159+ } , 'Should turn game audio "OFF" if isMuted === true' )
160+
161+ t . end ( )
162+ } )
163+
109164test ( 'should error on status not found' , t => {
110165let store = { status :'STATUS_NOT_IN_CREATE_MACHINE' }
111166const reducer = createMachine ( { } )