mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 16:44:07 -08:00
wip: fix tests
This commit is contained in:
parent
4567fb5507
commit
d0b080f6e9
|
@ -158,7 +158,14 @@ describe('POST /evaluation/test-definitions', () => {
|
|||
});
|
||||
|
||||
expect(resp.statusCode).toBe(400);
|
||||
expect(resp.body.message).toBe('Test definition name must be 1 to 255 characters long.');
|
||||
expect(resp.body.errors).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
code: 'too_small',
|
||||
path: ['name'],
|
||||
}),
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
test('should return error if user has no access to the workflow', async () => {
|
||||
|
@ -167,7 +174,7 @@ describe('POST /evaluation/test-definitions', () => {
|
|||
workflowId: otherWorkflow.id,
|
||||
});
|
||||
|
||||
expect(resp.statusCode).toBe(400);
|
||||
expect(resp.statusCode).toBe(403);
|
||||
expect(resp.body.message).toBe('User does not have access to the workflow');
|
||||
});
|
||||
|
||||
|
@ -178,7 +185,7 @@ describe('POST /evaluation/test-definitions', () => {
|
|||
evaluationWorkflowId: otherWorkflow.id,
|
||||
});
|
||||
|
||||
expect(resp.statusCode).toBe(400);
|
||||
expect(resp.statusCode).toBe(403);
|
||||
expect(resp.body.message).toBe('User does not have access to the evaluation workflow');
|
||||
});
|
||||
});
|
||||
|
@ -228,7 +235,7 @@ describe('PATCH /evaluation/test-definitions/:id', () => {
|
|||
evaluationWorkflowId: otherWorkflow.id,
|
||||
});
|
||||
|
||||
expect(resp.statusCode).toBe(400);
|
||||
expect(resp.statusCode).toBe(403);
|
||||
expect(resp.body.message).toBe('User does not have access to the evaluation workflow');
|
||||
});
|
||||
|
||||
|
@ -272,7 +279,7 @@ describe('PATCH /evaluation/test-definitions/:id', () => {
|
|||
await Container.get(TestDefinitionRepository).save(newTest);
|
||||
|
||||
const resp = await authOwnerAgent.patch(`/evaluation/test-definitions/${newTest.id}`).send({
|
||||
annotationTagId: 123,
|
||||
annotationTagId: '123',
|
||||
});
|
||||
|
||||
expect(resp.statusCode).toBe(400);
|
||||
|
|
Loading…
Reference in a new issue