From 0077f55a1f72a175d5e394c53dbab3c91da6fe9b Mon Sep 17 00:00:00 2001 From: Paolo Capriotti Date: Fri, 10 May 2024 15:35:37 +0200 Subject: [PATCH] Add assertions to MLS one-to-one test Check that the backend has an up-to-date view of the ciphersuite of a one-to-one conversation after the first commit. --- integration/test/Test/MLS/One2One.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/integration/test/Test/MLS/One2One.hs b/integration/test/Test/MLS/One2One.hs index 2598c10ad5b..c8b5e4deedb 100644 --- a/integration/test/Test/MLS/One2One.hs +++ b/integration/test/Test/MLS/One2One.hs @@ -22,6 +22,8 @@ import API.Galley import qualified Data.ByteString.Base64 as Base64 import qualified Data.ByteString.Char8 as B8 import qualified Data.Set as Set +import qualified Data.Text as T +import qualified Data.Text.Read as T import MLS.Util import Notifications import SetupHelpers @@ -257,3 +259,11 @@ testMLSOne2One suite scenario = do let isMessage n = nPayload n %. "type" `isEqual` "conversation.mls-message-add" n <- awaitMatch isMessage ws nPayload n %. "data" `shouldMatch` B8.unpack (Base64.encode mp.message) + + -- Send another commit. This verifies that the backend has correctly updated + -- the cipersuite of this conversation. + void $ createPendingProposalCommit alice1 >>= sendAndConsumeCommitBundle + + conv' <- getMLSOne2OneConversation alice bob >>= getJSON 200 + (suiteCode, _) <- assertOne $ T.hexadecimal (T.pack suite.code) + conv' %. "cipher_suite" `shouldMatchInt` suiteCode