Skip to content

Commit

Permalink
Add assertions to MLS one-to-one test (#4047)
Browse files Browse the repository at this point in the history
Check that the backend has an up-to-date view of the ciphersuite of a
one-to-one conversation after the first commit.
  • Loading branch information
pcapriotti committed May 13, 2024
1 parent 44a66c5 commit 0265f34
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions integration/test/Test/MLS/One2One.hs
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 0265f34

Please sign in to comment.