Skip to content

Commit 5582978

Browse files
committed
test: Add test for employee special group
1 parent fbdff1e commit 5582978

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/basic.spec.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,26 @@ test('User with no iam groups gets no access', async () => {
2020
specialGroup: {},
2121
})
2222
})
23+
24+
test('User with employee iam gets employee special group', async () => {
25+
const res = await api.post('', {
26+
userId: 'user-1',
27+
iamGroups: ['hy-employees'],
28+
})
29+
30+
expect(res.status).toBe(200)
31+
expect(await res.json()).toEqual({
32+
specialGroup: {
33+
employee: true,
34+
},
35+
})
36+
})
37+
38+
test('User without employee iam gets no special groups', async () => {
39+
const res = await api.post('', { userId: 'user-1', iamGroups: ['hy-pelle'] })
40+
41+
expect(res.status).toBe(200)
42+
expect(await res.json()).toEqual({
43+
specialGroup: {},
44+
})
45+
})

0 commit comments

Comments
 (0)