mirror of
https://github.com/strapi/strapi.git
synced 2025-10-29 08:59:34 +00:00
test: stage color
This commit is contained in:
parent
e7e3004524
commit
ec118b342d
@ -270,10 +270,25 @@ describeOnCondition(edition === 'EE')('Review workflows', () => {
|
|||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("It should assign a default color to stages if they don't have one", async () => {
|
||||||
|
await requests.admin.put(`/admin/review-workflows/workflows/${testWorkflow.id}/stages`, {
|
||||||
|
body: {
|
||||||
|
data: [defaultStage, { id: secondStage.id, name: 'new_name', color: '#000000' }],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const workflowRes = await requests.admin.get(
|
||||||
|
`/admin/review-workflows/workflows/${testWorkflow.id}?populate=*`
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(workflowRes.status).toBe(200);
|
||||||
|
expect(workflowRes.body.data.stages[0].color).toBe('#4945FF');
|
||||||
|
expect(workflowRes.body.data.stages[1].color).toBe('#000000');
|
||||||
|
});
|
||||||
test("It shouldn't be available for public", async () => {
|
test("It shouldn't be available for public", async () => {
|
||||||
const stagesRes = await requests.public.put(
|
const stagesRes = await requests.public.put(
|
||||||
`/admin/review-workflows/workflows/${testWorkflow.id}/stages`,
|
`/admin/review-workflows/workflows/${testWorkflow.id}/stages`,
|
||||||
stagesUpdateData
|
{ body: { data: stagesUpdateData } }
|
||||||
);
|
);
|
||||||
const workflowRes = await requests.public.get(
|
const workflowRes = await requests.public.get(
|
||||||
`/admin/review-workflows/workflows/${testWorkflow.id}`
|
`/admin/review-workflows/workflows/${testWorkflow.id}`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user