mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-04 06:32:59 +00:00
fix test
This commit is contained in:
1 parent
a07e60b3bb
commit
8f90d77e30
1 file changed
+12
-7
@@ -14,8 +14,9 @@ import Control.Concurrent (threadDelay)
|
||||
import Control.Concurrent.Async (async, cancel)
|
||||
import Control.Concurrent.STM (atomically, peekTQueue, tryReadTMVar)
|
||||
import Control.Exception (finally)
|
||||
import Control.Monad (forM_, when, void)
|
||||
import Control.Monad (forM_, replicateM, when, void)
|
||||
import qualified Data.Aeson as J
|
||||
import Data.List (partition)
|
||||
import qualified Data.Text as T
|
||||
import Directory.Captcha
|
||||
import Directory.Listing
|
||||
@@ -421,12 +422,16 @@ testJoinGroup ps =
|
||||
cath <## "connection request sent!"
|
||||
cath <## "#privacy: joining the group..."
|
||||
cath <## "#privacy: you joined the group, pending approval"
|
||||
cath <# "#privacy (support) 'SimpleX Directory_1'> Captcha is generated by SimpleX Directory service."
|
||||
cath <## ""
|
||||
cath <## "Send captcha text to join the group privacy."
|
||||
captcha <- dropStrPrefix "#privacy (support) 'SimpleX Directory_1'> " . dropTime <$> getTermLine cath
|
||||
cath <## "contact and member are merged: 'SimpleX Directory', #privacy 'SimpleX Directory_1'"
|
||||
cath <## "use @'SimpleX Directory' <message> to send messages"
|
||||
let mergedLines =
|
||||
[ "contact and member are merged: 'SimpleX Directory', #privacy 'SimpleX Directory_1'",
|
||||
"use @'SimpleX Directory' <message> to send messages"
|
||||
]
|
||||
directoryMsg = T.unpack . T.replace "'SimpleX Directory_1'> " "'SimpleX Directory'> " . T.pack . dropTime
|
||||
(merged, captchaLines) <- partition (`elem` mergedLines) <$> replicateM 6 (getTermLine cath)
|
||||
merged `shouldBe` mergedLines
|
||||
[intro, "", "Send captcha text to join the group privacy.", captchaLine] <- pure captchaLines
|
||||
directoryMsg intro `shouldBe` "#privacy (support) 'SimpleX Directory'> Captcha is generated by SimpleX Directory service."
|
||||
let captcha = dropStrPrefix "#privacy (support) 'SimpleX Directory'> " $ directoryMsg captchaLine
|
||||
cath #> ("#privacy (support) " <> captcha)
|
||||
cath <# ("#privacy (support) 'SimpleX Directory'!> > cath " <> captcha)
|
||||
cath <## " Correct, you joined the group privacy"
|
||||
|
||||
Reference in new issue
Block a user