Merge pull request #9801 from strapi/fix/test-warning

Delete useless test
This commit is contained in:
Alexandre BODIN 2021-03-22 16:29:10 +01:00 committed by GitHub
commit d7428b74c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -297,28 +297,6 @@ describe('Role', () => {
); );
}); });
test('Cannot delete a role used as the default role for new SSO users', async () => {
const dbFind = jest.fn(() => []);
const dbFindOne = jest.fn(() => ({}));
const dbCount = jest.fn(() => 0);
global.strapi = {
query: () => ({ find: dbFind, findOne: dbFindOne, count: dbCount }),
store: () => ({
get: () => ({
providers: {
defaultRole: 1,
},
}),
}),
admin: { config: { superAdminCode: SUPER_ADMIN_CODE } },
};
expect(() => roleService.deleteByIds([1])).rejects.toThrowError(
'This role is used as the default SSO role. Make sure to change this configuration before deleting the role'
);
});
test('Cannot delete a role attached to some user', async () => { test('Cannot delete a role attached to some user', async () => {
const dbFind = jest.fn(() => []); const dbFind = jest.fn(() => []);
const dbFindOne = jest.fn(() => ({})); const dbFindOne = jest.fn(() => ({}));