@@ -14,6 +14,7 @@ describe('getDataOutMetadata', () => {
1414 errorDetails : { } ,
1515 status : 'success' as const ,
1616 appKey : 'toolbox' ,
17+ key : 'forEach' ,
1718 createdAt : '2023-01-01T00:00:00Z' ,
1819 updatedAt : '2023-01-01T00:00:00Z' ,
1920 metadata : { } ,
@@ -561,7 +562,17 @@ describe('getDataOutMetadata', () => {
561562 }
562563 const executionStep = createMockExecutionStep ( dataOut )
563564
564- await expect ( getDataOutMetadata ( executionStep ) ) . rejects . toThrow ( )
565+ await expect ( getDataOutMetadata ( executionStep ) ) . resolves . toBeNull ( )
566+ } )
567+
568+ it ( 'should throw an error when inputSource is null' , async ( ) => {
569+ const dataOut = {
570+ iterations : 1 ,
571+ inputSource : null as any ,
572+ items : [ 'some' , 'data' ] ,
573+ }
574+ const executionStep = createMockExecutionStep ( dataOut )
575+ await expect ( getDataOutMetadata ( executionStep ) ) . resolves . toBeNull ( )
565576 } )
566577 } )
567578
@@ -574,7 +585,7 @@ describe('getDataOutMetadata', () => {
574585 const executionStep = createMockExecutionStep ( dataOut )
575586
576587 // This should throw because dataOutSchema.parse will fail
577- await expect ( getDataOutMetadata ( executionStep ) ) . rejects . toThrow ( )
588+ await expect ( getDataOutMetadata ( executionStep ) ) . resolves . toBeNull ( )
578589 } )
579590
580591 it ( 'should handle dataOut with missing iterations field' , async ( ) => {
@@ -585,7 +596,7 @@ describe('getDataOutMetadata', () => {
585596 }
586597 const executionStep = createMockExecutionStep ( dataOut )
587598
588- await expect ( getDataOutMetadata ( executionStep ) ) . rejects . toThrow ( )
599+ await expect ( getDataOutMetadata ( executionStep ) ) . resolves . toBeNull ( )
589600 } )
590601
591602 it ( 'should handle dataOut with missing items field' , async ( ) => {
@@ -596,7 +607,7 @@ describe('getDataOutMetadata', () => {
596607 }
597608 const executionStep = createMockExecutionStep ( dataOut )
598609
599- await expect ( getDataOutMetadata ( executionStep ) ) . rejects . toThrow ( )
610+ await expect ( getDataOutMetadata ( executionStep ) ) . resolves . toBeNull ( )
600611 } )
601612 } )
602613
0 commit comments