test: can not create more than 200 stages

This commit is contained in:
Marc-Roig 2023-04-24 11:52:05 +02:00
parent b06e4b4e98
commit 09e2107081

View File

@ -344,6 +344,19 @@ describeOnCondition(edition === 'EE')('Review workflows', () => {
expect(workflowRes.body.data).toBeUndefined();
}
});
test('It should throw an error if trying to create more than 200 stages', async () => {
const stagesRes = await requests.admin.put(
`/admin/review-workflows/workflows/${testWorkflow.id}/stages`,
{ body: { data: Array(201).fill({ name: 'new stage' }) } }
);
if (hasRW) {
expect(stagesRes.status).toBe(400);
expect(stagesRes.body.error).toBeDefined();
expect(stagesRes.body.error.name).toEqual('ValidationError');
expect(stagesRes.body.error.message).toBeDefined();
}
});
});
describe('Enabling/Disabling review workflows on a content type', () => {
@ -407,7 +420,7 @@ describeOnCondition(edition === 'EE')('Review workflows', () => {
});
});
describe('update a stage on an entity', () => {
describe('Update a stage on an entity', () => {
describe('Review Workflow is enabled', () => {
beforeAll(async () => {
await updateContentType(productUID, {