Skip to content

Commit

Permalink
feat: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FredrikOseberg authored and ivarconr committed Jan 11, 2022
1 parent d8ab79f commit 0129f23
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/test/e2e/services/access-service.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,3 +500,29 @@ test('should support permission with "ALL" environment requirement', async () =>
);
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);
});

0 comments on commit 0129f23

Please sign in to comment.