feat: Implement status filter for executions

This commit is contained in:
Faruk AYDIN
2025-03-26 16:07:22 +01:00
parent ab2c0378fd
commit 9fad4f5876
3 changed files with 19 additions and 1 deletions

View File

@@ -1377,16 +1377,19 @@ describe('User model', () => {
executionOne = await createExecution({
flowId: flow.id,
testRun: false,
status: 'success',
});
executionTwo = await createExecution({
flowId: flow.id,
testRun: true,
status: 'failure',
});
executionThree = await createExecution({
flowId: anotherUserFlow.id,
testRun: false,
status: 'success',
});
await createPermission({
@@ -1411,6 +1414,13 @@ describe('User model', () => {
expect(executions[1].id).toBe(executionOne.id);
});
it('should return executions filtered by status', async () => {
const executions = await currentUser.getExecutions({ status: 'failure' });
expect(executions).toHaveLength(1);
expect(executions[0].id).toBe(executionTwo.id);
});
it('should return all executions when no filter is applied', async () => {
const executions = await currentUser.getExecutions({});