[#13579] Added integration test for opening one-to-one chat (#13984)

This commit is contained in:
Emil Konstantinovitz 2022-08-12 12:09:53 +02:00 committed by Erik Seppanen
parent f4bb6ec7d6
commit 09e4df3cf7
No known key found for this signature in database
GPG Key ID: E466704B2D98E17D
2 changed files with 28 additions and 0 deletions

View File

@ -141,6 +141,10 @@
:setLazyComponentRegistrator identity :setLazyComponentRegistrator identity
:pop identity :pop identity
:push identity :push identity
:mergeOptions identity
:popToRoot identity
:showModal identity
:dismissModal identity
:registerComponent identity :registerComponent identity
:events :events
(fn [] (fn []

View File

@ -207,5 +207,29 @@
(rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in an inconsistent state between tests (rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in an inconsistent state between tests
(assert-logout)))))))) (assert-logout))))))))
(def chat-id "0x0402905bed83f0bbf993cee8239012ccb1a8bc86907ead834c1e38476a0eda71414eed0e25f525f270592a2eebb01c9119a4ed6429ba114e51f5cb0a28dae1adfd")
(deftest one-to-one-chat-test
(log/info "========= one-to-one-chat-test ==================")
(rf-test/run-test-async
(initialize-app!)
(rf-test/wait-for
[:status-im.init.core/initialize-view]
(generate-and-derive-addresses!)
(rf-test/wait-for
[:multiaccount-generate-and-derive-addresses-success] ; wait for the keys
(assert-multiaccount-loaded)
(create-multiaccount!)
(rf-test/wait-for
[::transport/messenger-started]
(assert-messenger-started)
(rf/dispatch-sync [:chat.ui/start-chat chat-id]) ;; start a new chat
(rf-test/wait-for
[:status-im.chat.models/one-to-one-chat-created]
(rf/dispatch-sync [:chat.ui/navigate-to-chat chat-id])
(is (= chat-id @(rf/subscribe [:chats/current-chat-id])))
(logout!) (rf-test/wait-for [::logout/logout-method] ; we need to logout to make sure the node is not in an inconsistent state between tests
(assert-logout))))))))
(comment (comment
(run-tests)) (run-tests))