test chat items (#285)

This commit is contained in:
Efim Poberezkin
2022-02-09 20:58:02 +04:00
committed by GitHub
parent 7af4cdffee
commit ff7a8cade1
9 changed files with 102 additions and 26 deletions

View File

@@ -70,7 +70,8 @@ cfg :: ChatConfig
cfg =
defaultChatConfig
{ agentConfig =
aCfg {reconnectInterval = (reconnectInterval aCfg) {initialInterval = 50000}}
aCfg {reconnectInterval = (reconnectInterval aCfg) {initialInterval = 50000}},
testView = True
}
virtualSimplexChat :: FilePath -> Profile -> IO TestCC
@@ -79,7 +80,7 @@ virtualSimplexChat dbFilePrefix profile = do
Right user <- runExceptT $ createUser st profile True
t <- withVirtualTerminal termSettings pure
ct <- newChatTerminal t
cc <- newChatController st (Just user) cfg opts {dbFilePrefix} . const $ pure () -- no notifications
cc <- newChatController st (Just user) cfg opts {dbFilePrefix} (const $ pure ()) -- no notifications
chatAsync <- async $ runSimplexChat user ct cc
termQ <- newTQueueIO
termAsync <- async $ readTerminalOutput t termQ