mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 07:03:38 +00:00
fix(ee): clean up roles and users after review workflows API test
This commit is contained in:
parent
957f4df2d2
commit
d71e6766be
@ -648,8 +648,14 @@ describeOnCondition(edition === 'EE')('Review workflows', () => {
|
||||
let utils;
|
||||
let entry;
|
||||
let restrictedRequest;
|
||||
let restrictedUser;
|
||||
let restrictedRole;
|
||||
|
||||
const deleteFixtures = async () => {
|
||||
await utils.deleteUserById(restrictedUser.id);
|
||||
await utils.deleteRolesById([restrictedRole.id]);
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
// Update workflow to assign content type
|
||||
await requests.admin.put(`/admin/review-workflows/workflows/${testWorkflow.id}?populate=*`, {
|
||||
@ -658,24 +664,28 @@ describeOnCondition(edition === 'EE')('Review workflows', () => {
|
||||
|
||||
entry = await createEntry(productUID, { name: 'Product' });
|
||||
|
||||
const restrictedUser = {
|
||||
email: 'restricted@user.io',
|
||||
password: 'Restricted123',
|
||||
};
|
||||
|
||||
utils = createUtils(strapi);
|
||||
const role = await utils.createRole({
|
||||
name: 'restricted-role',
|
||||
description: '',
|
||||
});
|
||||
restrictedRole = role;
|
||||
|
||||
await utils.createUserIfNotExists({
|
||||
...restrictedUser,
|
||||
const restrictedUserInfo = {
|
||||
email: 'restricted@user.io',
|
||||
password: 'Restricted123',
|
||||
};
|
||||
|
||||
restrictedUser = await utils.createUserIfNotExists({
|
||||
...restrictedUserInfo,
|
||||
roles: [role.id],
|
||||
});
|
||||
|
||||
restrictedRole = role;
|
||||
restrictedRequest = await createAuthRequest({ strapi, userInfo: restrictedUser });
|
||||
restrictedRequest = await createAuthRequest({ strapi, userInfo: restrictedUserInfo });
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await deleteFixtures();
|
||||
});
|
||||
|
||||
test("It shouldn't be available for public", async () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user