update tests

This commit is contained in:
Evgeny @ SimpleX Chat
2026-10-05 15:17:10 +00:00
parent ae9372a9db
commit 9fcf056237
2 changed files with 6 additions and 4 deletions
@@ -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 =
+2 -2
View File
@@ -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