From 5b90d92ca2c611166669db00a851d227b172c230 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sun, 24 Dec 2023 14:20:07 +0000 Subject: [PATCH] core: add group tests --- tests/ChatTests/Groups.hs | 65 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/tests/ChatTests/Groups.hs b/tests/ChatTests/Groups.hs index 868631024..28152e8f7 100644 --- a/tests/ChatTests/Groups.hs +++ b/tests/ChatTests/Groups.hs @@ -2619,8 +2619,8 @@ testPlanGroupLinkLeaveRejoin = testGroupLinkNoContact :: HasCallStack => FilePath -> IO () testGroupLinkNoContact = - testChat2 aliceProfile bobProfile $ - \alice bob -> do + testChat3 aliceProfile bobProfile cathProfile $ + \alice bob cath -> do alice ##> "/g team" alice <## "group #team is created" alice <## "to add members use /a team or /create link #team" @@ -2649,10 +2649,32 @@ testGroupLinkNoContact = bob #> "#team hi there" alice <# "#team bob> hi there" + cath ##> ("/c " <> gLink) + cath <## "connection request sent!" + concurrentlyN_ + [ do + alice <## "cath (Catherine): accepting request to join group #team..." + alice <## "#team: cath joined the group", + do + cath <## "#team: joining the group..." + cath <## "#team: you joined the group" + cath <## "#team: member bob (Bob) is connected", + do + bob <## "#team: alice added cath (Catherine) to the group (connecting...)" + bob <## "#team: new member cath is connected" + ] + cath #> "#team hey" + alice <# "#team cath> hey" + bob <# "#team cath> hey" + + bob #> "#team hi cath" + alice <# "#team bob> hi cath" + cath <# "#team bob> hi cath" + testGroupLinkNoContactMemberRole :: HasCallStack => FilePath -> IO () testGroupLinkNoContactMemberRole = - testChat2 aliceProfile bobProfile $ - \alice bob -> do + testChat3 aliceProfile bobProfile cathProfile $ + \alice bob cath -> do alice ##> "/g team" alice <## "group #team is created" alice <## "to add members use /a team or /create link #team" @@ -2692,6 +2714,41 @@ testGroupLinkNoContactMemberRole = bob #> "#team hey now" alice <# "#team bob> hey now" + cath ##> ("/c " <> gLink) + cath <## "connection request sent!" + concurrentlyN_ + [ do + alice <## "cath (Catherine): accepting request to join group #team..." + alice <## "#team: cath joined the group", + do + cath <## "#team: joining the group..." + cath <## "#team: you joined the group" + cath <## "#team: member bob (Bob) is connected", + do + bob <## "#team: alice added cath (Catherine) to the group (connecting...)" + bob <## "#team: new member cath is connected" + ] + bob #> "#team hi cath" + alice <# "#team bob> hi cath" + cath <# "#team bob> hi cath" + + cath ##> "#team hey" + cath <## "#team: you don't have permission to send messages" + + alice ##> "/mr #team cath admin" + alice <## "#team: you changed the role of cath from observer to admin" + cath <## "#team: alice changed your role from observer to admin" + bob <## "#team: alice changed the role of cath from observer to admin" + + cath #> "#team hey" + alice <# "#team cath> hey" + bob <# "#team cath> hey" + + cath ##> "/mr #team bob admin" + cath <## "#team: you changed the role of bob from member to admin" + bob <## "#team: cath changed your role from member to admin" + alice <## "#team: cath changed the role of bob from member to admin" + testGroupLinkNoContactHostIncognito :: HasCallStack => FilePath -> IO () testGroupLinkNoContactHostIncognito = testChat2 aliceProfile bobProfile $