core: improve some tests (#4000)

This commit is contained in:
spaced4ndy
2024-04-08 18:16:29 +04:00
committed by GitHub
parent 2968cd0460
commit 5b0c8e0f76

View File

@@ -2503,6 +2503,7 @@ testPlanHostContactDeletedGroupLinkKnown =
testPlanGroupLinkOwn :: HasCallStack => FilePath -> IO ()
testPlanGroupLinkOwn tmp =
withNewTestChatCfg tmp testCfgGroupLinkViaContact "alice" aliceProfile $ \alice -> do
threadDelay 100000
alice ##> "/g team"
alice <## "group #team is created"
alice <## "to add members use /a team <name> or /create link #team"
@@ -5186,7 +5187,11 @@ testGroupHistoryWelcomeMessage =
cath ##> "/_get chat #1 count=100"
r <- chat <$> getTermLine cath
r `shouldContain` [(0, "hello"), (0, "hey!"), (0, "welcome to team")]
-- sometimes there are "connected" and feature items in between,
-- so we filter them out; `shouldContain` then checks order is correct
let expected = [(0, "hello"), (0, "hey!"), (0, "welcome to team")]
r' = filter (`elem` expected) r
r' `shouldContain` expected
-- message delivery works after sending history
alice #> "#team 1"