feat: Extend execution serializer with status
This commit is contained in:
@@ -8,6 +8,10 @@ const executionSerializer = (execution) => {
|
|||||||
updatedAt: execution.updatedAt.getTime(),
|
updatedAt: execution.updatedAt.getTime(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (execution.status) {
|
||||||
|
executionData.status = execution.status;
|
||||||
|
}
|
||||||
|
|
||||||
if (execution.flow) {
|
if (execution.flow) {
|
||||||
executionData.flow = flowSerializer(execution.flow);
|
executionData.flow = flowSerializer(execution.flow);
|
||||||
}
|
}
|
||||||
|
@@ -26,6 +26,20 @@ describe('executionSerializer', () => {
|
|||||||
expect(executionSerializer(execution)).toEqual(expectedPayload);
|
expect(executionSerializer(execution)).toEqual(expectedPayload);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should return the execution data with status', async () => {
|
||||||
|
execution.status = 'success';
|
||||||
|
|
||||||
|
const expectedPayload = {
|
||||||
|
id: execution.id,
|
||||||
|
testRun: execution.testRun,
|
||||||
|
createdAt: execution.createdAt.getTime(),
|
||||||
|
updatedAt: execution.updatedAt.getTime(),
|
||||||
|
status: 'success',
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(executionSerializer(execution)).toEqual(expectedPayload);
|
||||||
|
});
|
||||||
|
|
||||||
it('should return the execution data with the flow', async () => {
|
it('should return the execution data with the flow', async () => {
|
||||||
execution.flow = flow;
|
execution.flow = flow;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user