mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-06 09:58:26 +00:00
update tests
This commit is contained in:
@@ -1214,11 +1214,13 @@ deleteItem cc citemId = do
|
||||
-- The member must have received the message before the command can find it.
|
||||
moderateBotItem :: HasCallStack => TestCC -> Text -> IO ()
|
||||
moderateBotItem member body = do
|
||||
void (pollUntil (queryFirst (chatController member) received) :: IO Int64)
|
||||
void (pollUntil received :: IO Int64)
|
||||
send member ("\\\\ #" <> groupName <> " @" <> botName <> " " <> T.unpack header)
|
||||
where
|
||||
header = T.takeWhile (/= '\n') body
|
||||
received = "SELECT chat_item_id FROM chat_items WHERE item_sent = 0 AND item_text LIKE '" <> T.unpack header <> "%'"
|
||||
received =
|
||||
withTransaction (chatStore $ chatController member) $ \db ->
|
||||
listToMaybe . map fromOnly <$> DB.query db "SELECT chat_item_id FROM chat_items WHERE item_sent = 0 AND item_text LIKE ? || '%'" (Only header)
|
||||
|
||||
waitModeratedItem :: HasCallStack => ChatController -> Int64 -> IO (Int, Maybe Int64, Text)
|
||||
waitModeratedItem cc citemId =
|
||||
|
||||
@@ -126,9 +126,9 @@ versionTestMatrix2 runTest = do
|
||||
it "prev" $ runTestCfg2 testCfgVPrev testCfgVPrev (runTest True True)
|
||||
it "prev to curr" $ runTestCfg2 testCfg testCfgVPrev (runTest True True)
|
||||
it "curr to prev" $ runTestCfg2 testCfgVPrev testCfg (runTest True True)
|
||||
it "old (1st supported)" $ testChatCfg2 testCfgV1 aliceProfile bobProfile (runTest True False)
|
||||
it "old (1st supported)" $ testChatCfg2 testCfgV1 aliceProfile bobProfile (runTest True True)
|
||||
it "old to curr" $ runTestCfg2 testCfg testCfgV1 (runTest True True)
|
||||
it "curr to old" $ runTestCfg2 testCfgV1 testCfg (runTest True False)
|
||||
it "curr to old" $ runTestCfg2 testCfgV1 testCfg (runTest True True)
|
||||
|
||||
versionTestMatrix3 :: (HasCallStack => TestCC -> TestCC -> TestCC -> IO ()) -> SpecWith TestParams
|
||||
versionTestMatrix3 runTest = do
|
||||
|
||||
Reference in New Issue
Block a user