@@ -313,34 +313,6 @@ describe('dataProtectorCore.getGrantedAccess()', () => {
313313 expect ( accessBefore ) . toBeDefined ( ) ;
314314 expect ( accessBefore . remainingAccess ) . toBe ( 5 ) ;
315315
316- // Mock the task processing to avoid actual execution but simulate consumption
317- const mockTaskObservable = {
318- subscribe : ( { complete } ) => {
319- if ( complete ) {
320- setTimeout ( ( ) => {
321- complete ( ) ;
322- } , 100 ) ; // Simulate some processing time
323- }
324- return ( ) => { } ;
325- } ,
326- } ;
327-
328- jest
329- . spyOn ( iexec . task , 'obsTask' )
330- . mockResolvedValue ( mockTaskObservable as any ) ;
331- jest
332- . spyOn ( iexec . deal , 'computeTaskId' )
333- . mockResolvedValue ( '0x123...taskid' ) ;
334-
335- // Mock the order matching to simulate successful order consumption
336- const mockMatchResult = {
337- dealid : '0x123...dealid' ,
338- txHash : '0x123...txhash' ,
339- volume : new BN ( 1 ) ,
340- } ;
341- jest
342- . spyOn ( iexec . order , 'matchOrders' )
343- . mockResolvedValue ( mockMatchResult ) ;
344316
345317 // Send 1 email (process the protected data)
346318 try {
@@ -373,8 +345,6 @@ describe('dataProtectorCore.getGrantedAccess()', () => {
373345 expect ( accessAfter ) . toHaveLength ( 1 ) ;
374346 expect ( accessAfter [ 0 ] . remainingAccess ) . toBe ( 4 ) ;
375347
376- // Restore mocks
377- jest . restoreAllMocks ( ) ;
378348 } ,
379349 15 * MAX_EXPECTED_BLOCKTIME + 2 * MAX_EXPECTED_WEB2_SERVICES_TIME
380350 ) ;
@@ -400,30 +370,6 @@ describe('dataProtectorCore.getGrantedAccess()', () => {
400370 numberOfAccess : 5 ,
401371 } ) ;
402372
403- // Mock and process 1 email
404- const mockTaskObservable = {
405- subscribe : ( { complete } ) => {
406- if ( complete ) {
407- setTimeout ( ( ) => {
408- complete ( ) ;
409- } , 100 ) ; // Simulate some processing time
410- }
411- return ( ) => { } ;
412- } ,
413- } ;
414-
415- jest
416- . spyOn ( iexec . task , 'obsTask' )
417- . mockResolvedValue ( mockTaskObservable as any ) ;
418- jest
419- . spyOn ( iexec . deal , 'computeTaskId' )
420- . mockResolvedValue ( '0x124...taskid' ) ;
421- jest . spyOn ( iexec . order , 'matchOrders' ) . mockResolvedValue ( {
422- dealid : '0x124...dealid' ,
423- txHash : '0x124...txhash' ,
424- volume : new BN ( 1 ) ,
425- } ) ;
426-
427373 try {
428374 await dataProtectorCore . processProtectedData ( {
429375 protectedData : protectedData . address ,
0 commit comments