mirror of
https://github.com/strapi/strapi.git
synced 2025-11-30 17:18:24 +00:00
fix: rw migration tests
This commit is contained in:
parent
c62acb8c5f
commit
70d1b600d5
@ -76,12 +76,6 @@ describeOnCondition(edition === 'EE')('Review workflows', () => {
|
|||||||
requests.admin = await createAuthRequest({ strapi });
|
requests.admin = await createAuthRequest({ strapi });
|
||||||
};
|
};
|
||||||
|
|
||||||
const getRWMorphTableResults = async (connection) =>
|
|
||||||
connection
|
|
||||||
.select('*')
|
|
||||||
.from('strapi_workflows_stages_related_morphs')
|
|
||||||
.where('related_type', productUID);
|
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await builder.addContentTypes([model]).build();
|
await builder.addContentTypes([model]).build();
|
||||||
// eslint-disable-next-line node/no-extraneous-require
|
// eslint-disable-next-line node/no-extraneous-require
|
||||||
@ -371,13 +365,16 @@ describeOnCondition(edition === 'EE')('Review workflows', () => {
|
|||||||
|
|
||||||
expect(response.body.data.schema.reviewWorkflows).toBeTruthy();
|
expect(response.body.data.schema.reviewWorkflows).toBeTruthy();
|
||||||
|
|
||||||
const morphTableResults = await getRWMorphTableResults(strapi.db.getConnection());
|
const {
|
||||||
|
body: { results },
|
||||||
|
} = await requests.admin({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/content-manager/collection-types/api::product.product',
|
||||||
|
});
|
||||||
|
|
||||||
expect(morphTableResults.length).toEqual(3);
|
expect(results.length).toEqual(3);
|
||||||
for (let i = 0; i < morphTableResults.length; i += 1) {
|
for (let i = 0; i < results.length; i += 1) {
|
||||||
const entry = morphTableResults[i];
|
expect(results[i][ENTITY_STAGE_ATTRIBUTE]).toBeDefined();
|
||||||
expect(entry.related_id).toEqual(i + 1);
|
|
||||||
expect(entry.order).toEqual(1);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -395,8 +392,16 @@ describeOnCondition(edition === 'EE')('Review workflows', () => {
|
|||||||
});
|
});
|
||||||
expect(response.body.data.schema.reviewWorkflows).toBeFalsy();
|
expect(response.body.data.schema.reviewWorkflows).toBeFalsy();
|
||||||
|
|
||||||
const morphTableResults = await getRWMorphTableResults(strapi.db.getConnection());
|
const {
|
||||||
expect(morphTableResults.length).toEqual(0);
|
body: { results },
|
||||||
|
} = await requests.admin({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/content-manager/collection-types/api::product.product',
|
||||||
|
});
|
||||||
|
|
||||||
|
for (let i = 0; i < results.length; i += 1) {
|
||||||
|
expect(results[i][ENTITY_STAGE_ATTRIBUTE]).toBeUndefined();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user