From a1225f57de7ee50bfdb1d39a2ca6e01546012d4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Dimja=C5=A1evi=C4=87?= Date: Wed, 13 Dec 2023 15:07:30 +0100 Subject: [PATCH] Test: Migrate "Remote connections: send then cancel" --- integration/test/Test/Connection.hs | 10 ++++++++++ services/brig/test/integration/API/User/Connection.hs | 8 -------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/integration/test/Test/Connection.hs b/integration/test/Test/Connection.hs index f95bf9f9bd3..88cfdd10764 100644 --- a/integration/test/Test/Connection.hs +++ b/integration/test/Test/Connection.hs @@ -184,3 +184,13 @@ testSentFromBlocked = do -- transitions to "sent" void $ putConnection alice bob "accepted" >>= getBody 200 assertConnectionStatus alice bob "sent" + +testCancel :: HasCallStack => App () +testCancel = do + [alice, bob] <- forM [OwnDomain, OtherDomain] $ flip randomUser def + + void $ postConnection alice bob >>= getBody 201 + assertConnectionStatus alice bob "sent" + + void $ putConnection alice bob "cancelled" >>= getBody 200 + assertConnectionStatus alice bob "cancelled" diff --git a/services/brig/test/integration/API/User/Connection.hs b/services/brig/test/integration/API/User/Connection.hs index bb1b128480e..8eeaae40a99 100644 --- a/services/brig/test/integration/API/User/Connection.hs +++ b/services/brig/test/integration/API/User/Connection.hs @@ -99,7 +99,6 @@ tests cl _at opts p b _c g fedBrigClient _fedGalleyClient db = test p "Remote connections: connect with Anon" (testConnectWithAnon b fedBrigClient), test p "Remote connections: connection from Anon" (testConnectFromAnon b), test p "Remote connections: connect twice" (testConnectFromPending b fedBrigClient), - test p "Remote connections: send then cancel" (testCancel opts b), test p "Remote connections: limits" (testConnectionLimits opts b fedBrigClient), test p "post /users/connections-status/v2 : All connections" (testInternalGetConnStatusesAll b opts fedBrigClient) ] @@ -750,13 +749,6 @@ testConnectFromPending brig fedBrigClient = do receiveConnectionAction brig fedBrigClient uid1 quid2 RemoteConnect Nothing Pending receiveConnectionAction brig fedBrigClient uid1 quid2 RemoteRescind Nothing Cancelled -testCancel :: Opt.Opts -> Brig -> Http () -testCancel opts brig = do - (uid1, quid2) <- localAndRemoteUser brig - - sendConnectionAction brig opts uid1 quid2 Nothing Sent - sendConnectionUpdateAction brig opts uid1 quid2 Nothing Cancelled - testConnectionLimits :: Opt.Opts -> Brig -> FedClient 'Brig -> Http () testConnectionLimits opts brig fedBrigClient = do let connectionLimit = Opt.setUserMaxConnections (Opt.optSettings opts)