Skip to content

Commit

Permalink
[chore] add test that confirms behaviour of LH from the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MangoIV committed Jun 24, 2024
1 parent b9a9fbc commit a721a33
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions integration/test/Test/LegalHold.hs
Original file line number Diff line number Diff line change
Expand Up @@ -873,8 +873,8 @@ testLHCannotCreateGroupWithUsersInConflict = do
postConversation bob defProteus {qualifiedUsers = [debora, alice], newUsersRole = "wire_member", team = Just tidAlice}
>>= assertLabel 403 "missing-legalhold-consent"

testNoConsentCannotBeInvited :: (HasCallStack) => App ()
testNoConsentCannotBeInvited = do
testLHNoConsentCannotBeInvited :: (HasCallStack) => App ()
testLHNoConsentCannotBeInvited = do
-- team that is legalhold whitelisted
(legalholder, tidLH, userLHNotActivated : _) <- createTeam OwnDomain 2
legalholdWhitelistTeam tidLH legalholder >>= assertStatus 200
Expand Down Expand Up @@ -904,3 +904,22 @@ testNoConsentCannotBeInvited = do
resp.json %. "status" `shouldMatch` "enabled"

addMembers userLHNotActivated cid (def {users = [peer3]}) >>= assertLabel 403 "not-connected"

testLHRequestDeletionHasUserEffect :: (HasCallStack) => App ()
testLHRequestDeletionHasUserEffect = do
(alice, tid, [bob]) <- createTeam OwnDomain 2
legalholdWhitelistTeam tid alice >>= assertStatus 200

withMockServer def lhMockApp \lhDomAndPort _chan -> do
postLegalHoldSettings tid alice (mkLegalHoldSettings lhDomAndPort) >>= assertStatus 201

-- alice requests a legalhold device for bob and sets his status to "pending"
requestLegalHoldDevice tid alice bob >>= assertSuccess
let getBob'sStatus = (getUser bob bob >>= getJSON 200) %. "legalhold_status" & asString
getBob'sStatus `shouldMatch` "pending"

-- alice disables legalhold. the status for bob should now not be pending anymore
requestLegalHoldDevice tid alice bob >>= assertSuccess
disableLegalHold tid alice bob defPassword
>>= assertStatus 204
getBob'sStatus `shouldMatch` "disabled"

0 comments on commit a721a33

Please sign in to comment.