test(review-workflow): refresh data between tests

This commit is contained in:
nathan-pichon 2023-06-23 14:26:49 +02:00
parent e1b1c1322f
commit e72ca4b13c
No known key found for this signature in database

View File

@ -119,6 +119,14 @@ describeOnCondition(edition === 'EE')('Review workflows', () => {
stages: [defaultStage.id, secondStage.id], stages: [defaultStage.id, secondStage.id],
}, },
}); });
defaultStage = await strapi.query(STAGE_MODEL_UID).update({
where: { id: defaultStage.id },
data: { name: 'Stage' },
});
secondStage = await strapi.query(STAGE_MODEL_UID).update({
where: { id: secondStage.id },
data: { name: 'Stage 2' },
});
await updateContentType(productUID, { await updateContentType(productUID, {
components: [], components: [],
contentType: model, contentType: model,
@ -474,10 +482,12 @@ describeOnCondition(edition === 'EE')('Review workflows', () => {
describe('Review Workflow is enabled', () => { describe('Review Workflow is enabled', () => {
beforeAll(async () => { beforeAll(async () => {
// Update workflow to unassign content type // Update workflow to unassign content type
await requests.admin.put( const workflow = await requests.admin.put(
`/admin/review-workflows/workflows/${testWorkflow.id}?populate=*`, `/admin/review-workflows/workflows/${testWorkflow.id}?populate=*`,
{ body: { data: { contentTypes: [productUID] } } } { body: { data: { contentTypes: [productUID] } } }
); );
console.log(workflow);
}); });
test('Should update the accordingly on an entity', async () => { test('Should update the accordingly on an entity', async () => {