mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-07 01:16:28 +02:00
feat: add tests
This commit is contained in:
parent
d8ab79f71c
commit
0129f23e97
@ -500,3 +500,29 @@ test('should support permission with "ALL" environment requirement', async () =>
|
|||||||
);
|
);
|
||||||
expect(hasNotAccess).toBe(true);
|
expect(hasNotAccess).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Should have access to create a strategy in an environment', async () => {
|
||||||
|
const { CREATE_FEATURE_STRATEGY } = permissions;
|
||||||
|
const user = editorUser;
|
||||||
|
expect(
|
||||||
|
await accessService.hasPermission(
|
||||||
|
user,
|
||||||
|
CREATE_FEATURE_STRATEGY,
|
||||||
|
'default',
|
||||||
|
'development',
|
||||||
|
),
|
||||||
|
).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Should be denied access to create a strategy in an environment the user does not have access to', async () => {
|
||||||
|
const { CREATE_FEATURE_STRATEGY } = permissions;
|
||||||
|
const user = editorUser;
|
||||||
|
expect(
|
||||||
|
await accessService.hasPermission(
|
||||||
|
user,
|
||||||
|
CREATE_FEATURE_STRATEGY,
|
||||||
|
'default',
|
||||||
|
'noaccess',
|
||||||
|
),
|
||||||
|
).toBe(false);
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user