mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
40 lines
1.1 KiB
Haskell
40 lines
1.1 KiB
Haskell
{-# LANGUAGE OverloadedStrings #-}
|
|
{-# LANGUAGE PostfixOperators #-}
|
|
|
|
module ChatTests.Local where
|
|
|
|
import ChatClient
|
|
import ChatTests.Utils
|
|
import Test.Hspec
|
|
|
|
chatLocalTests :: SpecWith FilePath
|
|
chatLocalTests = do
|
|
fdescribe "note folders" $ do
|
|
it "create folders, add notes, read, search" testNotes
|
|
it "switch users" testUserNotes
|
|
|
|
testNotes :: FilePath -> IO ()
|
|
testNotes tmp = withNewTestChat tmp "alice" aliceProfile $ \alice -> do
|
|
alice ##> "/create note folder self"
|
|
alice <## "note folder created, write to $self to add notes"
|
|
|
|
alice ##> "$self keep in mind"
|
|
alice <## "ok"
|
|
|
|
testUserNotes :: FilePath -> IO ()
|
|
testUserNotes tmp = withNewTestChat tmp "alice" aliceProfile $ \alice -> do
|
|
alice ##> "/create note folder self"
|
|
alice <## "note folder created, write to $self to add notes"
|
|
|
|
alice ##> "$self keep in mind"
|
|
alice <## "ok"
|
|
alice ##> "/chats"
|
|
alice <## "$self keep in mind"
|
|
|
|
alice ##> "/create user secret"
|
|
alice <## "user profile: secret"
|
|
alice <## "use /p <display name> to change it"
|
|
alice <## "(the updated profile will be sent to all your contacts)"
|
|
|
|
alice ##> "/chats"
|