Skip to content

Commit a55fbe6

Browse files
committed
WIP: implement a test for the server side of the POST
/federation/mls-welcome endpoint
1 parent c42678a commit a55fbe6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

services/galley/test/integration/API/Federation.hs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
module API.Federation where
3737

38+
import API.MLS.Util
3839
import API.Util
3940
import Bilge
4041
import Bilge.Assert
@@ -63,6 +64,7 @@ import Federator.MockServer (FederatedRequest (..))
6364
import Galley.Types
6465
import Galley.Types.Conversations.Intra
6566
import Imports
67+
import System.IO.Temp
6668
import Test.QuickCheck (arbitrary, generate)
6769
import Test.Tasty
6870
import qualified Test.Tasty.Cannon as WS
@@ -106,7 +108,8 @@ tests s =
106108
test s "POST /federation/on-message-sent : Receive a message from another backend" onMessageSent,
107109
test s "POST /federation/send-message : Post a message sent from another backend" sendMessage,
108110
test s "POST /federation/on-user-deleted-conversations : Remove deleted remote user from local conversations" onUserDeleted,
109-
test s "POST /federation/update-conversation : Update local conversation by a remote admin " updateConversationByRemoteAdmin
111+
test s "POST /federation/update-conversation : Update local conversation by a remote admin " updateConversationByRemoteAdmin,
112+
test s "POST /federation/mls-welcome : Post an MLS welcome message from another backend" sendMLSWelcome
110113
]
111114

112115
getConversationsAllFound :: TestM ()
@@ -1158,6 +1161,13 @@ updateConversationByRemoteAdmin = do
11581161
let convUpdate :: ConversationUpdate = fromRight (error $ "Could not parse ConversationUpdate from " <> show (frBody rpc)) $ A.eitherDecode (frBody rpc)
11591162
pure (rpc, convUpdate)
11601163

1164+
sendMLSWelcome :: TestM ()
1165+
sendMLSWelcome = withSystemTempDirectory "mls" $ \tmp -> do
1166+
-- add bob to it and get welcome message
1167+
let bob = undefined
1168+
(_commit, _welcome) <- liftIO $ setupCommit tmp "group" "group" (pClients bob)
1169+
undefined
1170+
11611171
getConvAction :: Sing tag -> SomeConversationAction -> Maybe (ConversationAction tag)
11621172
getConvAction tquery (SomeConversationAction tag action) =
11631173
case (tag, tquery) of

0 commit comments

Comments
 (0)