mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
wip: delete response
This commit is contained in:
parent
2482903c7c
commit
41d0cd2d44
|
@ -59,7 +59,9 @@ export class TestDefinitionsController {
|
||||||
|
|
||||||
if (workflowIds.length === 0) throw new NotFoundError('Test not found');
|
if (workflowIds.length === 0) throw new NotFoundError('Test not found');
|
||||||
|
|
||||||
return await this.testsService.delete(Number(req.params.id), workflowIds);
|
await this.testsService.delete(Number(req.params.id), workflowIds);
|
||||||
|
|
||||||
|
return { success: true };
|
||||||
}
|
}
|
||||||
|
|
||||||
@Patch('/:id')
|
@Patch('/:id')
|
||||||
|
|
|
@ -279,3 +279,18 @@ describe('PATCH /evaluation/test-definitions/:id', () => {
|
||||||
expect(resp.body.message).toBe('Annotation tag not found');
|
expect(resp.body.message).toBe('Annotation tag not found');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('DELETE /evaluation/test-definitions/:id', () => {
|
||||||
|
test('should delete test definition', async () => {
|
||||||
|
const newTest = Container.get(TestDefinitionRepository).create({
|
||||||
|
name: 'test',
|
||||||
|
workflow: { id: workflowUnderTest.id },
|
||||||
|
});
|
||||||
|
await Container.get(TestDefinitionRepository).save(newTest);
|
||||||
|
|
||||||
|
const resp = await authOwnerAgent.delete(`/evaluation/test-definitions/${newTest.id}`);
|
||||||
|
|
||||||
|
expect(resp.statusCode).toBe(200);
|
||||||
|
expect(resp.body.data.success).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in a new issue