@@ -18,11 +18,12 @@ import {
18
18
setProfileAvatarDescriptionRequest ,
19
19
setProfileAvatarDescriptionSuccess
20
20
} from './actions'
21
+ import { getIdentityOrRedirect } from '../identity/sagas'
22
+ import { call } from 'redux-saga/effects'
21
23
22
24
let mockAuthIdentity : AuthIdentity | undefined = { } as AuthIdentity
23
25
24
26
const profileSagas = createProfileSaga ( {
25
- getIdentity : ( ) => mockAuthIdentity ,
26
27
peerUrl : 'aURL'
27
28
} )
28
29
const address = 'anAddress'
@@ -58,7 +59,8 @@ describe('when handling the action to set the profile avatar description', () =>
58
59
EntitiesOperator . prototype . deployEntityWithoutNewFiles
59
60
) ,
60
61
Promise . reject ( new Error ( errorMessage ) )
61
- ]
62
+ ] ,
63
+ [ call ( getIdentityOrRedirect ) , mockAuthIdentity ]
62
64
] )
63
65
. put ( setProfileAvatarDescriptionFailure ( address , errorMessage ) )
64
66
. dispatch ( setProfileAvatarDescriptionRequest ( address , description ) )
@@ -83,6 +85,7 @@ describe('when handling the action to set the profile avatar description', () =>
83
85
84
86
return expectSaga ( profileSagas )
85
87
. provide ( [
88
+ [ call ( getIdentityOrRedirect ) , mockAuthIdentity ] ,
86
89
[
87
90
matchers . call . fn ( PeerAPI . prototype . fetchProfile ) ,
88
91
dynamicDeepParametersEquality (
@@ -166,6 +169,7 @@ describe('when handling the action to set the profile avatar alias', () => {
166
169
it ( 'should dispatch an action to signal that the request failed' , ( ) => {
167
170
return expectSaga ( profileSagas )
168
171
. provide ( [
172
+ [ call ( getIdentityOrRedirect ) , mockAuthIdentity ] ,
169
173
[
170
174
matchers . call . fn ( PeerAPI . prototype . fetchProfile ) ,
171
175
Promise . resolve ( profileFromLambda )
@@ -201,6 +205,7 @@ describe('when handling the action to set the profile avatar alias', () => {
201
205
202
206
return expectSaga ( profileSagas )
203
207
. provide ( [
208
+ [ call ( getIdentityOrRedirect ) , mockAuthIdentity ] ,
204
209
[
205
210
matchers . call . fn ( PeerAPI . prototype . fetchProfile ) ,
206
211
dynamicDeepParametersEquality (
0 commit comments