|
18 | 18 | module Federation.End2end where
|
19 | 19 |
|
20 | 20 | import API.Search.Util
|
21 |
| -import API.User.Util (getUserClientsQualified) |
| 21 | +import API.User.Util |
22 | 22 | import Bilge
|
23 | 23 | import Bilge.Assert ((!!!), (<!!), (===))
|
24 | 24 | import Brig.API.Client (pubClient)
|
@@ -98,7 +98,8 @@ spec _brigOpts mg brig galley cannon _federator brigTwo galleyTwo =
|
98 | 98 | test mg "leave a remote conversation" $ leaveRemoteConversation brig galley brigTwo galleyTwo,
|
99 | 99 | test mg "include remote users to new conversation" $ testRemoteUsersInNewConv brig galley brigTwo galleyTwo,
|
100 | 100 | test mg "send a message to a remote user" $ testSendMessage brig brigTwo galleyTwo cannon,
|
101 |
| - test mg "send a message in a remote conversation" $ testSendMessageToRemoteConv brig brigTwo galley galleyTwo cannon |
| 101 | + test mg "send a message in a remote conversation" $ testSendMessageToRemoteConv brig brigTwo galley galleyTwo cannon, |
| 102 | + test mg "delete user connected to remotes and in conversation with remotes" $ testDeleteUser brig brigTwo galley galleyTwo cannon |
102 | 103 | ]
|
103 | 104 |
|
104 | 105 | -- | Path covered by this test:
|
@@ -595,3 +596,26 @@ testSendMessageToRemoteConv brig1 brig2 galley1 galley2 cannon1 = do
|
595 | 596 | @?= EdOtrMessage
|
596 | 597 | ( OtrMessage bobClient aliceClient (toBase64Text msgText) (Just "")
|
597 | 598 | )
|
| 599 | + |
| 600 | +testDeleteUser :: Brig -> Brig -> Galley -> Galley -> Cannon -> Http () |
| 601 | +testDeleteUser brig1 brig2 galley1 galley2 cannon1 = do |
| 602 | + alice <- userQualifiedId <$> randomUser brig1 |
| 603 | + bobDel <- userQualifiedId <$> randomUser brig2 |
| 604 | + |
| 605 | + connectUsersEnd2End brig1 brig2 alice bobDel |
| 606 | + |
| 607 | + conv1 <- |
| 608 | + fmap cnvQualifiedId . responseJsonError |
| 609 | + =<< createConversation galley1 (qUnqualified alice) [bobDel] |
| 610 | + <!! const 201 === statusCode |
| 611 | + |
| 612 | + conv2 <- |
| 613 | + fmap cnvQualifiedId . responseJsonError |
| 614 | + =<< createConversation galley2 (qUnqualified bobDel) [alice] |
| 615 | + <!! const 201 === statusCode |
| 616 | + |
| 617 | + WS.bracketR cannon1 (qUnqualified alice) $ \wsAlice -> do |
| 618 | + deleteUser (qUnqualified bobDel) (Just defPassword) brig2 !!! const 200 === statusCode |
| 619 | + WS.assertMatch_ (5 # Second) wsAlice $ matchDeleteUserNotification bobDel |
| 620 | + WS.assertMatch_ (5 # Second) wsAlice $ matchConvLeaveNotification conv1 bobDel [bobDel] |
| 621 | + WS.assertMatch_ (5 # Second) wsAlice $ matchConvLeaveNotification conv2 bobDel [bobDel] |
0 commit comments