Skip to content

Commit 28c1d12

Browse files
committed
Test removal from user group on deletion
1 parent 1b5a58b commit 28c1d12

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

integration/test/Test/UserGroup.hs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,3 +373,20 @@ testUserGroupMembersCount = do
373373
resp.status `shouldMatchInt` 200
374374
resp.json %. "page.0.membersCount" `shouldMatchInt` 2
375375
resp.json %. "total" `shouldMatchInt` 1
376+
377+
testUserGroupRemovalOnDelete :: (HasCallStack) => App ()
378+
testUserGroupRemovalOnDelete = do
379+
(alice, tid, [bob, charlie]) <- createTeam OwnDomain 3
380+
381+
bobId <- bob %. "id" & asString
382+
charlieId <- charlie %. "id" & asString
383+
384+
ug <-
385+
createUserGroup alice (object ["name" .= "none", "members" .= [bobId, charlieId]])
386+
>>= getJSON 200
387+
gid <- ug %. "id" & asString
388+
void $ deleteTeamMember tid alice bob >>= getBody 202
389+
390+
bindResponse (getUserGroup alice gid) $ \resp -> do
391+
resp.status `shouldMatchInt` 200
392+
resp.json %. "members" `shouldMatch` [charlieId]

0 commit comments

Comments
 (0)