Skip to content

Commit e7837d1

Browse files
author
Roman Snapko
committed
fix: tests
1 parent 30590bc commit e7837d1

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

packages/server/api/test/unit/flow-run/flow-run-service.test.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,17 @@ describe('flowRunService.recordTriggerFailure', () => {
102102
},
103103
});
104104

105-
expect(fileServiceMock.save).toHaveBeenCalledWith({
106-
data: Buffer.from('compressed-logs'),
107-
type: FileType.FLOW_RUN_LOG,
108-
compression: FileCompression.GZIP,
109-
projectId: 'proj_1',
110-
});
105+
expect(fileServiceMock.save).toHaveBeenCalledTimes(1);
106+
const saveArg = (fileServiceMock.save as jest.Mock).mock.calls[0][0];
107+
expect(saveArg).toEqual(
108+
expect.objectContaining({
109+
fileId: expect.any(String),
110+
data: Buffer.from('compressed-logs'),
111+
type: FileType.FLOW_RUN_LOG,
112+
compression: FileCompression.GZIP,
113+
projectId: 'proj_1',
114+
}),
115+
);
111116

112117
expect(mockedRepo.save).toHaveBeenCalledTimes(1);
113118
const saved = mockedRepo.save.mock.calls[0][0];
@@ -125,8 +130,8 @@ describe('flowRunService.recordTriggerFailure', () => {
125130
tasks: 0,
126131
duration: 0,
127132
tags: [],
128-
logsFileId: 'file_123',
129133
});
134+
expect(saved.logsFileId).toBe(saveArg.fileId);
130135

131136
expect(typeof saved.id).toBe('string');
132137
expect(saved.id.length).toBeGreaterThan(0);

0 commit comments

Comments
 (0)