@@ -196,7 +196,7 @@ describe('ProofService', () => {
196
196
const presentationProblemReportMessage = await new PresentationProblemReportMessage ( {
197
197
description : {
198
198
en : 'Indy error' ,
199
- code : PresentationProblemReportReason . abandoned ,
199
+ code : PresentationProblemReportReason . Abandoned ,
200
200
} ,
201
201
} )
202
202
@@ -224,7 +224,7 @@ describe('ProofService', () => {
224
224
const presentationProblemReportMessage = new PresentationProblemReportMessage ( {
225
225
description : {
226
226
en : 'Indy error' ,
227
- code : PresentationProblemReportReason . abandoned ,
227
+ code : PresentationProblemReportReason . Abandoned ,
228
228
} ,
229
229
} )
230
230
presentationProblemReportMessage . setThread ( { threadId : 'somethreadid' } )
@@ -233,7 +233,7 @@ describe('ProofService', () => {
233
233
} )
234
234
} )
235
235
236
- test ( `updates state to ${ ProofState . None } and returns proof record` , async ( ) => {
236
+ test ( `updates problem report error message and returns proof record` , async ( ) => {
237
237
const repositoryUpdateSpy = jest . spyOn ( proofRepository , 'update' )
238
238
239
239
// given
@@ -244,7 +244,7 @@ describe('ProofService', () => {
244
244
245
245
// then
246
246
const expectedCredentialRecord = {
247
- state : ProofState . None ,
247
+ errorMessage : 'abandoned: Indy error' ,
248
248
}
249
249
expect ( proofRepository . getSingleByQuery ) . toHaveBeenNthCalledWith ( 1 , {
250
250
threadId : 'somethreadid' ,
@@ -255,27 +255,5 @@ describe('ProofService', () => {
255
255
expect ( updatedCredentialRecord ) . toMatchObject ( expectedCredentialRecord )
256
256
expect ( returnedCredentialRecord ) . toMatchObject ( expectedCredentialRecord )
257
257
} )
258
-
259
- test ( `emits stateChange event from ${ ProofState . RequestReceived } to ${ ProofState . None } ` , async ( ) => {
260
- const eventListenerMock = jest . fn ( )
261
- eventEmitter . on < ProofStateChangedEvent > ( ProofEventTypes . ProofStateChanged , eventListenerMock )
262
-
263
- // given
264
- mockFunction ( proofRepository . getSingleByQuery ) . mockReturnValue ( Promise . resolve ( proof ) )
265
-
266
- // when
267
- await proofService . processProblemReport ( messageContext )
268
-
269
- // then
270
- expect ( eventListenerMock ) . toHaveBeenCalledWith ( {
271
- type : 'ProofStateChanged' ,
272
- payload : {
273
- previousState : ProofState . RequestReceived ,
274
- proofRecord : expect . objectContaining ( {
275
- state : ProofState . None ,
276
- } ) ,
277
- } ,
278
- } )
279
- } )
280
258
} )
281
259
} )
0 commit comments