File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
src/PublicApi/v1/handlers/executions
test/integration/publicApi Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import Container from 'typedi';
8
8
import { ExecutionRepository } from '@/databases/repositories' ;
9
9
10
10
function getStatusCondition ( status : ExecutionStatus | ExecutionStatus [ ] ) {
11
+ const condition : Pick < FindOptionsWhere < IExecutionFlattedDb > , 'status' > = { } ;
11
12
if ( typeof status === 'string' ) {
12
13
status = [ status ] ;
13
14
}
@@ -22,7 +23,8 @@ function getStatusCondition(status: ExecutionStatus | ExecutionStatus[]) {
22
23
output . add ( currFilter ) ;
23
24
}
24
25
}
25
- return In ( Array . from ( output ) ) ;
26
+ condition . status = In ( Array . from ( output ) ) ;
27
+ return condition ;
26
28
}
27
29
28
30
export async function getExecutions ( params : {
Original file line number Diff line number Diff line change @@ -301,9 +301,13 @@ describe('GET /executions', () => {
301
301
} ) ;
302
302
303
303
expect ( response . statusCode ) . toBe ( 200 ) ;
304
- expect ( response . body . data . length ) . toBe ( 1 ) ;
305
304
expect ( response . body . nextCursor ) . toBe ( null ) ;
306
-
305
+ if ( filterStatus === 'error' ) {
306
+ // Check for breaking change
307
+ expect ( response . body . data . length ) . toBe ( 3 ) ;
308
+ } else {
309
+ expect ( response . body . data . length ) . toBe ( 1 ) ;
310
+ }
307
311
const {
308
312
id,
309
313
finished,
@@ -362,8 +366,12 @@ describe('GET /executions', () => {
362
366
} ) ;
363
367
364
368
expect ( response . statusCode ) . toBe ( 200 ) ;
365
- expect ( response . body . data . length ) . toBe ( filterStatusList . length ) ;
366
-
369
+ if ( filterStatusList . includes ( 'error' ) ) {
370
+ // Check for breaking change
371
+ expect ( response . body . data . length ) . toBe ( filterStatusList . length + 2 ) ;
372
+ } else {
373
+ expect ( response . body . data . length ) . toBe ( filterStatusList . length ) ;
374
+ }
367
375
for ( let execution of response . body . data ) {
368
376
const {
369
377
id,
You can’t perform that action at this time.
0 commit comments