@@ -157,8 +157,8 @@ testImplicitConnectionNoCollaborator = do
157
157
-- Alice and Bob aren't connected at all.
158
158
postOne2OneConversation bob alice team0 " chit-chat" >>= assertLabel 403 " no-team-member"
159
159
160
- testRemoveMemberInO2O :: (HasCallStack ) => App ()
161
- testRemoveMemberInO2O = do
160
+ testRemoveMemberInTeamsO2O :: (HasCallStack ) => App ()
161
+ testRemoveMemberInTeamsO2O = do
162
162
(owner0, team0, [alice]) <- createTeam OwnDomain 2
163
163
(owner1, team1, [bob]) <- createTeam OwnDomain 2
164
164
@@ -197,6 +197,32 @@ testRemoveMemberInO2OConnected = do
197
197
198
198
getMLSOne2OneConversation bob alice >>= assertSuccess
199
199
200
+ testRemoveMemberInO2O :: (HasCallStack ) => App ()
201
+ testRemoveMemberInO2O = do
202
+ (owner0, team0, [alice]) <- createTeam OwnDomain 2
203
+
204
+ -- At the time of writing, it wasn't clear if this should be a bot instead.
205
+ bob <- randomUser OwnDomain def
206
+ addTeamCollaborator owner0 team0 bob [" implicit_connection" ] >>= assertSuccess
207
+
208
+ teamConvId <-
209
+ postOne2OneConversation bob alice team0 " chit-chat" `bindResponse` \ resp -> do
210
+ resp. status `shouldMatchInt` 201
211
+ resp. json %. " qualified_id"
212
+ Internal. getConversation teamConvId >>= assertSuccess
213
+
214
+ connectTwoUsers alice bob
215
+ personalConvId <- postConversation alice defProteus {qualifiedUsers = [bob]} >>= getJSON 201
216
+ Internal. getConversation personalConvId >>= assertSuccess
217
+
218
+ removeTeamCollaborator owner0 team0 bob >>= assertSuccess
219
+
220
+ postOne2OneConversation bob alice team0 " chit-chat" >>= assertLabel 403 " no-team-member"
221
+ Internal. getConversation teamConvId >>= assertLabel 404 " no-conversation"
222
+
223
+ getMLSOne2OneConversation bob alice >>= assertSuccess
224
+ Internal. getConversation personalConvId >>= assertSuccess
225
+
200
226
testRemoveMemberInTeamConversation :: (HasCallStack ) => App ()
201
227
testRemoveMemberInTeamConversation = do
202
228
(owner, team, [alice, bob]) <- createTeam OwnDomain 3
@@ -210,8 +236,7 @@ testRemoveMemberInTeamConversation = do
210
236
withWebSockets [owner, alice] $ \ [wsOwner, wsAlice] -> do
211
237
removeTeamCollaborator owner team bob >>= assertSuccess
212
238
213
- bobId <- bob %. " qualified_id"
214
- bobUnqualifiedId <- bobId %. " id"
239
+ bobUnqualifiedId <- bob %. " qualified_id.id"
215
240
let checkEvent :: (MakesValue a ) => a -> App ()
216
241
checkEvent evt = do
217
242
evt %. " payload.0.data.user" `shouldMatch` bobUnqualifiedId
0 commit comments