Skip to content

Commit

Permalink
test(core): Add tests for endless execution issue (#7420)
Browse files Browse the repository at this point in the history
The first test ("itemless case") was originally added
[here](https://github.com/n8n-io/n8n/pull/7305/files#diff-7bc4c6fd25a41ea39cef04208c96965f55787e1983e9df748fcd923672959f8bL24)
but likely removed on accident.
  • Loading branch information
ivov authored Oct 12, 2023
1 parent b203665 commit e2af7ef
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/cli/test/unit/execution.lifecycle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
});
}

0 comments on commit e2af7ef

Please sign in to comment.