@@ -18,10 +18,10 @@ describe.each([
1818 [ actionCreators . setOverlayVisibility , [ false ] , { type : actions . SET_OVERLAY_VISIBILITY , visibility : false } ] ,
1919 [ actionCreators . setTriggerPosition , [ 12 , 12 ] , { type : actions . SET_TRIGGER_POSITION , x : 12 , y : 12 } ] ,
2020 [ actionCreators . setTriggerPosition , [ 52 , 112 ] , { type : actions . SET_TRIGGER_POSITION , x : 52 , y : 112 } ] ,
21- [ actionCreators . setAuthStatus , [ true ] , { type : actions . SET_AUTH_STATUS , authInfo : true } ] ,
22- [ actionCreators . setAuthStatus , [ false ] , { type : actions . SET_AUTH_STATUS , authInfo : false } ] ,
23- [ actionCreators . setAuthToken , [ 'string' ] , { type : actions . SET_AUTH_TOKEN , authInfo : 'string' } ] ,
24- [ actionCreators . setAuthToken , [ null ] , { type : actions . SET_AUTH_TOKEN , authInfo : null } ]
21+ [ actionCreators . setAuthStatus , [ true ] , { type : actions . SET_AUTH_STATUS , authInfo : true } ] ,
22+ [ actionCreators . setAuthStatus , [ false ] , { type : actions . SET_AUTH_STATUS , authInfo : false } ] ,
23+ [ actionCreators . setAuthToken , [ 'string' ] , { type : actions . SET_AUTH_TOKEN , authInfo : 'string' } ] ,
24+ [ actionCreators . setAuthToken , [ null ] , { type : actions . SET_AUTH_TOKEN , authInfo : null } ]
2525] ) ( 'Test Set actionCreators' , ( method , input , expectedAction ) => {
2626 test ( `check if an action of type ${ expectedAction . type } is returned when method actionCreator.${ method . name } () is called` , ( ) => {
2727 expect ( method ( ...input ) ) . toEqual ( expectedAction ) ;
@@ -206,9 +206,9 @@ describe('Test Async actionCreators', () => {
206206 fetchMock . restore ( ) ;
207207 } ) ;
208208
209- it ( 'dispatches SET_AUTH_STATUS when fetching auth info and not authorised ' , ( ) => {
209+ it ( 'dispatches SET_AUTH_STATUS when fetching auth info and not authorized ' , ( ) => {
210210 let token = 'token'
211- fetchMock . once ( '/authenticate_request ' , {
211+ fetchMock . once ( '/authenticate ' , {
212212 body : {
213213 authStatus : false ,
214214 error : {
@@ -218,23 +218,23 @@ describe('Test Async actionCreators', () => {
218218 }
219219 }
220220 } ) ;
221- const expectedActions = [ actions . SET_AUTH_STATUS , actions . SET_AUTH_TOKEN ] ;
221+ const expectedActions = [ actions . SET_AUTH_STATUS ] ;
222222
223223 return store . dispatch ( actionCreators . updateAuthStatus ( token ) ) . then ( ( ) => {
224224 const received = store . getActions ( ) ;
225225 expect ( received . map ( ( a ) => a . type ) ) . toEqual ( expectedActions ) ;
226226 } ) ;
227227 } ) ;
228228
229- it ( 'dispatches SET_AUTH_STATUS, when fetching auth info and authorised ' , ( ) => {
229+ it ( 'dispatches SET_AUTH_STATUS, when fetching auth info and authorized ' , ( ) => {
230230 let token = 'token'
231- fetchMock . once ( '/authenticate_request ' , {
231+ fetchMock . once ( '/authenticate ' , {
232232 body : {
233233 authStatus : true ,
234234 error : null
235235 }
236236 } ) ;
237- const expectedActions = [ actions . SET_AUTH_STATUS , actions . SET_AUTH_TOKEN ] ;
237+ const expectedActions = [ actions . SET_AUTH_STATUS ] ;
238238
239239 return store . dispatch ( actionCreators . updateAuthStatus ( token ) ) . then ( ( ) => {
240240 const received = store . getActions ( ) ;
0 commit comments