Skip to content

Commit

Permalink
MLS test improvements (#2271)
Browse files Browse the repository at this point in the history
* Simplify assertion in MLS integration test

* Remove redundant patterns in MLS integration test
  • Loading branch information
pcapriotti authored Apr 12, 2022
1 parent 9ba1c3b commit 19a6935
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions services/galley/test/integration/API/MLS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,16 @@ testSuccessfulCommitWithNewUsers MessagingSetup {..} newUsers = do
if null newUsers
then do
-- check that alice receives no events
assertBool ("expected no events, received " <> show events) (null events)
events @?= []

-- check that no users receive join events
WS.assertNoEvent (1 # WS.Second) wss
else do
-- check that alice receives a join event
case (events, newUsers) of
([], []) -> pure () -- no users added, no event received
(es, []) -> assertFailure $ "expected no events, received " <> show es
([e], _) -> assertJoinEvent conversation (pUserId creator) newUsers roleNameWireMember e
([], _) -> assertFailure "expected join event to be returned to alice"
(es, _) -> assertFailure $ "expected one event, found: " <> show es
case events of
[e] -> assertJoinEvent conversation (pUserId creator) newUsers roleNameWireMember e
[] -> assertFailure "expected join event to be returned to alice"
es -> assertFailure $ "expected one event, found: " <> show es

-- check that all users receive a join event
for_ wss $ \ws -> do
Expand Down

0 comments on commit 19a6935

Please sign in to comment.