fix tests

This commit is contained in:
Evgeny @ SimpleX Chat committed 2026-09-11 12:21:35 +00:00
1 parent ed0dde2e70
commit 5df24d72c2
2 files changed
+8 -7

No files matched your search

+4 -4
View File
@@ -21,7 +21,7 @@ import Data.Aeson (ToJSON)
import qualified Data.Aeson as J
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy.Char8 as LB
import Data.List (intercalate, stripPrefix)
import Data.List (intercalate, sort, stripPrefix)
import qualified Data.Text as T
import Simplex.Chat.AppSettings (defaultAppSettings)
import qualified Simplex.Chat.AppSettings as AS
@@ -1998,14 +1998,14 @@ testMultipleUserAddresses =
cLinkAlisa <- getContactLink alice True
bob ##> ("/c " <> cLinkAlisa)
alice <#? bob
alice #$> ("/_get chats 2 pcc=on", chats, [("@bob", "Audio/video calls: enabled"), ("@Ask SimpleX Team", ""), ("*", ""), ("%", "")])
alice #$> ("/_get chats 2 pcc=on", sort . chats, sort [("@bob", "Audio/video calls: enabled"), ("@Ask SimpleX Team", ""), ("*", ""), ("%", "")])
alice ##> "/ac bob"
alice <## "bob (Bob): accepting contact request, you can send messages to contact"
concurrently_
(bob <## "alisa: contact is connected")
(alice <## "bob (Bob): contact is connected")
threadDelay 100000
alice #$> ("/_get chats 2 pcc=on", chats, [("@bob", lastChatFeature), ("@Ask SimpleX Team", ""), ("*", ""), ("%", "")])
alice #$> ("/_get chats 2 pcc=on", sort . chats, sort [("@bob", lastChatFeature), ("@Ask SimpleX Team", ""), ("*", ""), ("%", "")])
alice <##> bob
bob #> "@alice hey alice"
@@ -2036,7 +2036,7 @@ testMultipleUserAddresses =
(cath <## "alisa: contact is connected")
(alice <## "cath (Catherine): contact is connected")
threadDelay 100000
alice #$> ("/_get chats 2 pcc=on", chats, [("@cath", lastChatFeature), ("@bob", "hey"), ("@Ask SimpleX Team", ""), ("*", ""), ("%", "")])
alice #$> ("/_get chats 2 pcc=on", sort . chats, sort [("@cath", lastChatFeature), ("@bob", "hey"), ("@Ask SimpleX Team", ""), ("*", ""), ("%", "")])
alice <##> cath
-- first user doesn't have cath as contact
+4 -3
View File
@@ -18,6 +18,7 @@ import Control.Monad
import Control.Monad.Except
import qualified Data.Attoparsec.ByteString.Char8 as A
import qualified Data.ByteString.Char8 as B
import Data.List (sort)
import qualified Data.Text as T
import Data.Time.Clock (UTCTime, addUTCTime, getCurrentTime, nominalDay)
import Data.Time.Clock.POSIX (posixSecondsToUTCTime)
@@ -4043,7 +4044,7 @@ testShortLinkChangePreparedContactUser = testChat2 aliceProfile bobProfile test
alice @@@ [("@robert", "hey")]
alice `hasContactProfiles` ["alice", "robert"]
bob #$> ("/_get chats 2 pcc=on", chats, [("@alice", "hey"), ("@Ask SimpleX Team", ""), ("*", ""), ("%", "")])
bob #$> ("/_get chats 2 pcc=on", sort . chats, sort [("@alice", "hey"), ("@Ask SimpleX Team", ""), ("*", ""), ("%", "")])
bob `hasContactProfiles` ["robert", "alice", "Ask SimpleX Team"]
bob ##> "/user bob"
showActiveUser bob "bob (Bob)"
@@ -4100,7 +4101,7 @@ testShortLinkChangePreparedContactUserDuplicate = testChat2 aliceProfile bobProf
alice @@@ [("@robert", "hey"), ("@robert_1", "hey")]
alice `hasContactProfiles` ["alice", "robert", "robert"]
bob #$> ("/_get chats 2 pcc=on", chats, [("@alice", "hey"), ("@alice_1", "hey"), ("@Ask SimpleX Team", ""), ("*", ""), ("%", "")])
bob #$> ("/_get chats 2 pcc=on", sort . chats, sort [("@alice", "hey"), ("@alice_1", "hey"), ("@Ask SimpleX Team", ""), ("*", ""), ("%", "")])
bob `hasContactProfiles` ["robert", "alice", "alice", "Ask SimpleX Team"]
bob ##> "/user bob"
showActiveUser bob "bob (Bob)"
@@ -4194,7 +4195,7 @@ testShortLinkChangePreparedGroupUser = testChat3 aliceProfile bobProfile cathPro
alice @@@ [("#team", "3"), ("@cath","sent invitation to join group team as admin")]
alice `hasContactProfiles` ["alice", "cath", "robert"]
bob #$> ("/_get chats 2 pcc=on", chats, [("#team", "3"), ("@Ask SimpleX Team", ""), ("*", ""), ("%", "")])
bob #$> ("/_get chats 2 pcc=on", sort . chats, sort [("#team", "3"), ("@Ask SimpleX Team", ""), ("*", ""), ("%", "")])
bob `hasContactProfiles` ["robert", "alice", "cath", "Ask SimpleX Team"]
cath @@@ [("#team", "3"), ("@alice","received invitation to join group team as admin")]
cath `hasContactProfiles` ["cath", "alice", "robert"]