1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

fix: update root role test

This commit is contained in:
Fredrik Oseberg 2022-01-04 11:13:06 +01:00 committed by Ivar Conradi Østhus
parent 563345695d
commit fb109d79a6
No known key found for this signature in database
GPG Key ID: 31AC596886B0BD09

View File

@ -615,14 +615,10 @@ test('should set root role for user', async () => {
await accessService.setUserRootRole(user.id, editorRole.id);
const roles = await accessService.getRolesForUser(user.id);
roles.sort((x, y) => {
return x.name.localeCompare(y.name);
});
//To have duplicated roles like this may not may not be a hack. Needs some thought
expect(roles[0].name).toBe(RoleName.EDITOR);
expect(roles[1].name).toBe(RoleName.VIEWER);
expect(roles.length).toBe(2);
expect(roles.length).toBe(1);
});
test('should switch root role for user', async () => {