diff --git a/packages/cli/test/unit/execution.lifecycle.test.ts b/packages/cli/test/unit/execution.lifecycle.test.ts index 611c10496d914..c41465c8e508a 100644 --- a/packages/cli/test/unit/execution.lifecycle.test.ts +++ b/packages/cli/test/unit/execution.lifecycle.test.ts @@ -101,6 +101,32 @@ for (const mode of ['filesystem-v2', 's3'] as const) { expect(binaryDataService.rename).not.toHaveBeenCalled(); expect(getDataId(run, 'json')).toBe(dataId); }); + + it('should do nothing on itemless case', async () => { + const executionId = '999'; + + const promise = restoreBinaryDataId(toIRun(), executionId); + + await expect(promise).resolves.not.toThrow(); + + expect(binaryDataService.rename).not.toHaveBeenCalled(); + }); + + it('should do nothing if data is undefined', async () => { + const executionId = '999'; + + const run = toIRun({ + json: { + data: undefined, + }, + }); + + const promise = restoreBinaryDataId(run, executionId); + + await expect(promise).resolves.not.toThrow(); + + expect(binaryDataService.rename).not.toHaveBeenCalled(); + }); }); }); }