Skip to content

Commit

Permalink
Only run setup if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveWM committed Oct 30, 2023
1 parent f4468ab commit bd97ac0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
8 changes: 6 additions & 2 deletions src/status_im2/integration_test/helpers.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
(rf/dispatch [:profile.create/create-and-login
{:display-name constants/account-name :password constants/password :color "blue"}]))

(defn assert-app-initialized
(defn app-initialized
[]
(let [app-state @(rf/subscribe [:app-state])]
(is (= "active" app-state))))
(= "active" app-state)))

(defn assert-app-initialized
[]
(is (app-initialized)))

(defn messenger-started
[]
Expand Down
24 changes: 14 additions & 10 deletions src/status_im2/integration_test/macros.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@

(defmacro with-app-initialized
[& body]
`(do
(rf/dispatch [:app-started])
(rf-test/wait-for
[:profile/get-profiles-overview-success]
~@body)))
`(if (status-im2.integration-test.helpers/app-initialized)
(do ~@body)
(do
(rf/dispatch [:app-started])
(rf-test/wait-for
[:profile/get-profiles-overview-success]
~@body))))

(defmacro with-account
[& body]
`(do
(status-im2.integration-test.helpers/create-multiaccount!)
(rf-test/wait-for
[:status-im.transport.core/messenger-started]
~@body)))
`(if (status-im2.integration-test.helpers/messenger-started)
(do ~@body)
(do
(status-im2.integration-test.helpers/create-multiaccount!)
(rf-test/wait-for
[:status-im.transport.core/messenger-started]
~@body))))

0 comments on commit bd97ac0

Please sign in to comment.