chore: rename alias of promesa to be more verbose (#19332)

This commit is contained in:
Jamie Caprani 2024-03-28 16:33:16 +00:00 committed by GitHub
parent e6d9ef0298
commit 53874c8343
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 120 additions and 117 deletions

View File

@ -26,7 +26,7 @@
malli.generator malli.generator malli.generator malli.generator
malli.transform malli.transform malli.transform malli.transform
malli.util malli.util malli.util malli.util
promesa.core p promesa.core promesa
schema.core schema schema.core schema
status-im.feature-flags ff status-im.feature-flags ff
taoensso.timbre log}} taoensso.timbre log}}

View File

@ -1,6 +1,6 @@
(ns quo.components.profile.expanded-collectible.view (ns quo.components.profile.expanded-collectible.view
(:require (:require
[promesa.core :as p] [promesa.core :as promesa]
[quo.components.counter.collectible-counter.view :as collectible-counter] [quo.components.counter.collectible-counter.view :as collectible-counter]
[quo.components.icon :as icon] [quo.components.icon :as icon]
[quo.components.markdown.text :as text] [quo.components.markdown.text :as text]
@ -37,7 +37,7 @@
[image-size set-image-size] (rn/use-state {})] [image-size set-image-size] (rn/use-state {})]
(rn/use-effect (rn/use-effect
(fn [] (fn []
(p/let [[image-width image-height] (rn/image-get-size image-src)] (promesa/let [[image-width image-height] (rn/image-get-size image-src)]
(set-image-size {:width image-width (set-image-size {:width image-width
:height image-height :height image-height
:aspect-ratio (/ image-width image-height)}))) :aspect-ratio (/ image-width image-height)})))

View File

@ -3,7 +3,7 @@
["react" :as react] ["react" :as react]
["react-native" :as react-native] ["react-native" :as react-native]
[oops.core :as oops] [oops.core :as oops]
[promesa.core :as p] [promesa.core :as promesa]
[react-native.flat-list :as flat-list] [react-native.flat-list :as flat-list]
[react-native.platform :as platform] [react-native.platform :as platform]
[react-native.section-list :as section-list] [react-native.section-list :as section-list]
@ -37,11 +37,11 @@
(defn image-get-size (defn image-get-size
[uri] [uri]
(p/create (fn [res rej] (promesa/create (fn [res rej]
(.getSize ^js (.-Image ^js react-native) (.getSize ^js (.-Image ^js react-native)
uri uri
(fn [width height] (res [width height])) (fn [width height] (res [width height]))
rej)))) rej))))
(def text (reagent/adapt-react-class (.-Text ^js react-native))) (def text (reagent/adapt-react-class (.-Text ^js react-native)))
(def text-input (reagent/adapt-react-class (.-TextInput ^js react-native))) (def text-input (reagent/adapt-react-class (.-TextInput ^js react-native)))

View File

@ -1,6 +1,6 @@
(ns status-im.common.log (ns status-im.common.log
(:require (:require
[clojure.pprint :as p] [clojure.pprint :as promesa]
[clojure.string :as string] [clojure.string :as string]
[native-module.core :as native-module] [native-module.core :as native-module]
[re-frame.core :as re-frame] [re-frame.core :as re-frame]
@ -43,7 +43,8 @@
:middleware [(fn [data] :middleware [(fn [data]
(update data (update data
:vargs :vargs
(partial mapv #(if (string? %) % (with-out-str (p/pprint %))))))]}) (partial mapv
#(if (string? %) % (with-out-str (promesa/pprint %))))))]})
(native-module/init-status-go-logging logging-params))))) (native-module/init-status-go-logging logging-params)))))
(re-frame/reg-fx (re-frame/reg-fx

View File

@ -1,7 +1,7 @@
(ns status-im.contexts.chat.messenger.photo-selector.effects (ns status-im.contexts.chat.messenger.photo-selector.effects
(:require (:require
[clojure.string :as string] [clojure.string :as string]
[promesa.core :as p] [promesa.core :as promesa]
[react-native.cameraroll :as cameraroll] [react-native.cameraroll :as cameraroll]
[react-native.core :as rn] [react-native.core :as rn]
[react-native.image-resizer :as image-resizer] [react-native.image-resizer :as image-resizer]
@ -31,19 +31,19 @@
(defn- resize-photo (defn- resize-photo
[uri] [uri]
(p/let [[width height] (rn/image-get-size uri) (promesa/let [[width height] (rn/image-get-size uri)
resize? (> (max width height) resize? (> (max width height)
maximum-image-size-px) maximum-image-size-px)
resized-uri (-> (image-resizer/resize resized-uri (-> (image-resizer/resize
{:max-width (if resize? maximum-image-size-px width) {:max-width (if resize? maximum-image-size-px width)
:max-height (if resize? maximum-image-size-px height) :max-height (if resize? maximum-image-size-px height)
:path uri :path uri
:quality 60}) :quality 60})
(p/then (fn [^js resized-image] (promesa/then (fn [^js resized-image]
(let [path (.-path resized-image)] (let [path (.-path resized-image)]
(if (string/starts-with? path "file") (if (string/starts-with? path "file")
path path
(str "file://" path))))))] (str "file://" path))))))]
{:resized-uri resized-uri {:resized-uri resized-uri
:width width :width width
:height height})) :height height}))
@ -51,9 +51,9 @@
(rf/reg-fx :effects.camera-roll/image-selected (rf/reg-fx :effects.camera-roll/image-selected
(fn [[image chat-id]] (fn [[image chat-id]]
(-> (resize-photo (:uri image)) (-> (resize-photo (:uri image))
(p/then #(rf/dispatch (promesa/then #(rf/dispatch
[:photo-selector/image-selected chat-id image %])) [:photo-selector/image-selected chat-id image %]))
(p/catch #(log/error "could not resize image" %))))) (promesa/catch #(log/error "could not resize image" %)))))
(defn- get-albums (defn- get-albums
[callback] [callback]

View File

@ -1,13 +1,13 @@
(ns status-im.contexts.communities.actions.accounts-selection.effects (ns status-im.contexts.communities.actions.accounts-selection.effects
(:require (:require
[promesa.core :as p] [promesa.core :as promesa]
[schema.core :as schema] [schema.core :as schema]
[status-im.common.json-rpc.events :as rpc] [status-im.common.json-rpc.events :as rpc]
[utils.re-frame :as rf])) [utils.re-frame :as rf]))
(defn- generate-requests-for-signing (defn- generate-requests-for-signing
[pub-key community-id addresses-to-reveal] [pub-key community-id addresses-to-reveal]
(p/create (promesa/create
(fn [p-resolve p-reject] (fn [p-resolve p-reject]
(rpc/call (rpc/call
{:method :wakuext_generateJoiningCommunityRequestsForSigning {:method :wakuext_generateJoiningCommunityRequestsForSigning
@ -17,7 +17,7 @@
(defn- sign-data (defn- sign-data
[sign-params password] [sign-params password]
(p/create (promesa/create
(fn [p-resolve p-reject] (fn [p-resolve p-reject]
(rpc/call (rpc/call
{:method :wakuext_signData {:method :wakuext_signData
@ -27,7 +27,7 @@
(defn- edit-shared-addresses-for-community (defn- edit-shared-addresses-for-community
[community-id signatures addresses-to-reveal airdrop-address] [community-id signatures addresses-to-reveal airdrop-address]
(p/create (promesa/create
(fn [p-resolve p-reject] (fn [p-resolve p-reject]
(rpc/call (rpc/call
{:method :wakuext_editSharedAddressesForCommunity {:method :wakuext_editSharedAddressesForCommunity
@ -41,7 +41,7 @@
(defn- request-to-join (defn- request-to-join
[community-id signatures addresses-to-reveal airdrop-address] [community-id signatures addresses-to-reveal airdrop-address]
(p/create (promesa/create
(fn [p-resolve p-reject] (fn [p-resolve p-reject]
(rpc/call (rpc/call
{:method :wakuext_requestToJoinCommunity {:method :wakuext_requestToJoinCommunity
@ -66,14 +66,14 @@
addresses-to-reveal airdrop-address addresses-to-reveal airdrop-address
on-success on-error on-success on-error
callback]}] callback]}]
(-> (p/let [sign-params (generate-requests-for-signing pub-key community-id addresses-to-reveal) (-> (promesa/let [sign-params (generate-requests-for-signing pub-key community-id addresses-to-reveal)
signatures (sign-data sign-params password) signatures (sign-data sign-params password)
result (callback community-id result (callback community-id
signatures signatures
addresses-to-reveal addresses-to-reveal
airdrop-address)] airdrop-address)]
(run-callback-or-event on-success result)) (run-callback-or-event on-success result))
(p/catch #(run-callback-or-event on-error %)))) (promesa/catch #(run-callback-or-event on-error %))))
(schema/=> sign-and-call-endpoint (schema/=> sign-and-call-endpoint
[:=> [:=>

View File

@ -5,7 +5,7 @@
[legacy.status-im.multiaccounts.logout.core :as logout] [legacy.status-im.multiaccounts.logout.core :as logout]
legacy.status-im.subs.root legacy.status-im.subs.root
[native-module.core :as native-module] [native-module.core :as native-module]
[promesa.core :as p] [promesa.core :as promesa]
[re-frame.core :as rf] [re-frame.core :as rf]
[re-frame.interop :as rf.interop] [re-frame.interop :as rf.interop]
status-im.events status-im.events
@ -20,7 +20,7 @@
(defn validate-mnemonic (defn validate-mnemonic
[mnemonic] [mnemonic]
(p/create (promesa/create
(fn [p-resolve p-reject] (fn [p-resolve p-reject]
(native-module/validate-mnemonic (native-module/validate-mnemonic
(security/safe-unmask-data mnemonic) (security/safe-unmask-data mnemonic)
@ -111,7 +111,7 @@
(wait-for event-ids default-re-frame-wait-for-timeout-ms)) (wait-for event-ids default-re-frame-wait-for-timeout-ms))
([event-ids timeout-ms] ([event-ids timeout-ms]
(let [waiting-ids (atom event-ids)] (let [waiting-ids (atom event-ids)]
(p/create (promesa/create
(fn [promise-resolve promise-reject] (fn [promise-resolve promise-reject]
(let [cb-id (gensym "post-event-callback") (let [cb-id (gensym "post-event-callback")
timer-id (js/setTimeout (fn [] timer-id (js/setTimeout (fn []
@ -148,18 +148,18 @@
[] []
(test-utils/init!) (test-utils/init!)
(if (app-initialized) (if (app-initialized)
(p/resolved ::app-initialized) (promesa/resolved ::app-initialized)
(p/do! (promesa/do!
(rf/dispatch [:app-started]) (rf/dispatch [:app-started])
(wait-for [:profile/get-profiles-overview-success])))) (wait-for [:profile/get-profiles-overview-success]))))
(defn setup-account (defn setup-account
[] []
(if (messenger-started) (if (messenger-started)
(p/resolved ::messenger-started) (promesa/resolved ::messenger-started)
(p/do! (promesa/do!
(create-multiaccount!) (create-multiaccount!)
(p/then (wait-for [:profile.login/messenger-started]) #(assert-messenger-started))))) (promesa/then (wait-for [:profile.login/messenger-started]) #(assert-messenger-started)))))
(defn- recover-and-login (defn- recover-and-login
[seed-phrase] [seed-phrase]
@ -176,8 +176,8 @@
(defn- recover-multiaccount! (defn- recover-multiaccount!
[] []
(p/let [masked-seed-phrase (security/mask-data (:seed-phrase constants/recovery-account)) (promesa/let [masked-seed-phrase (security/mask-data (:seed-phrase constants/recovery-account))
[mnemonic key-uid] (validate-mnemonic masked-seed-phrase)] [mnemonic key-uid] (validate-mnemonic masked-seed-phrase)]
(rf/dispatch [:onboarding/seed-phrase-validated (security/mask-data mnemonic) key-uid]) (rf/dispatch [:onboarding/seed-phrase-validated (security/mask-data mnemonic) key-uid])
(rf/dispatch [:pop-to-root :screen/profile.profiles]) (rf/dispatch [:pop-to-root :screen/profile.profiles])
(rf/dispatch [:profile/profile-selected key-uid]) (rf/dispatch [:profile/profile-selected key-uid])
@ -186,12 +186,12 @@
(defn setup-recovered-account (defn setup-recovered-account
[] []
(if (messenger-started) (if (messenger-started)
(p/resolved ::messenger-started) (promesa/resolved ::messenger-started)
(p/do! (promesa/do!
(recover-multiaccount!) (recover-multiaccount!)
(p/then (wait-for [:profile.login/messenger-started]) #(assert-messenger-started)) (promesa/then (wait-for [:profile.login/messenger-started]) #(assert-messenger-started))
(enable-testnet!) (enable-testnet!)
(p/then (wait-for [:wallet/store-wallet-token]) #(assert-wallet-loaded))))) (promesa/then (wait-for [:wallet/store-wallet-token]) #(assert-wallet-loaded)))))
(defn test-async (defn test-async
"Runs `f` inside `cljs.test/async` macro in a restorable re-frame checkpoint. "Runs `f` inside `cljs.test/async` macro in a restorable re-frame checkpoint.
@ -225,21 +225,21 @@
done done
(let [restore-fn (rf/make-restore-fn)] (let [restore-fn (rf/make-restore-fn)]
(log-headline test-name) (log-headline test-name)
(-> (p/do (f done)) (-> (promesa/do (f done))
(p/timeout timeout-ms) (promesa/timeout timeout-ms)
(p/catch (fn [error] (promesa/catch (fn [error]
(is (nil? error)) (is (nil? error))
(when fail-fast? (when fail-fast?
(js/process.exit 1)))) (js/process.exit 1))))
(p/finally (fn [] (promesa/finally (fn []
(restore-fn) (restore-fn)
(done)))))))) (done))))))))
(defn test-app-initialization (defn test-app-initialization
[] []
(test-async ::initialize-app (test-async ::initialize-app
(fn [] (fn []
(p/do (promesa/do
(test-utils/init!) (test-utils/init!)
(rf/dispatch [:app-started]) (rf/dispatch [:app-started])
;; Use initialize-view because it has the longest avg. time and is ;; Use initialize-view because it has the longest avg. time and is
@ -252,7 +252,7 @@
[] []
(test-async ::create-account (test-async ::create-account
(fn [] (fn []
(p/do (promesa/do
(setup-app) (setup-app)
(setup-account) (setup-account)
(logout) (logout)
@ -271,19 +271,19 @@
{:before (if (= :recovered-account type) {:before (if (= :recovered-account type)
(fn [] (fn []
(test/async done (test/async done
(p/do (setup-app) (promesa/do (setup-app)
(setup-recovered-account) (setup-recovered-account)
(done)))) (done))))
(fn [] (fn []
(test/async done (test/async done
(p/do (setup-app) (promesa/do (setup-app)
(setup-account) (setup-account)
(done))))) (done)))))
:after (fn [] :after (fn []
(test/async done (test/async done
(p/do (logout) (promesa/do (logout)
(wait-for [::logout/logout-method]) (wait-for [::logout/logout-method])
(done))))}) (done))))})
([] (fixture-session [:new-account]))) ([] (fixture-session [:new-account])))
(defn fixture-silence-reframe (defn fixture-silence-reframe

View File

@ -3,7 +3,7 @@
[cljs.test :refer [deftest is use-fixtures]] [cljs.test :refer [deftest is use-fixtures]]
legacy.status-im.events legacy.status-im.events
legacy.status-im.subs.root legacy.status-im.subs.root
[promesa.core :as p] [promesa.core :as promesa]
status-im.events status-im.events
status-im.navigation.core status-im.navigation.core
status-im.subs.root status-im.subs.root
@ -16,4 +16,4 @@
(h/test-async :contract/wakuext_setBio (h/test-async :contract/wakuext_setBio
(fn [] (fn []
(-> (contract-utils/call-rpc "wakuext_setBio" "new bio") (-> (contract-utils/call-rpc "wakuext_setBio" "new bio")
(p/catch #(is (nil? %) "Set bio RPC call should have succeeded")))))) (promesa/catch #(is (nil? %) "Set bio RPC call should have succeeded"))))))

View File

@ -1,12 +1,12 @@
(ns tests.contract-test.utils (ns tests.contract-test.utils
(:require (:require
[promesa.core :as p] [promesa.core :as promesa]
[status-im.common.json-rpc.events :as rpc-events] [status-im.common.json-rpc.events :as rpc-events]
[utils.number])) [utils.number]))
(defn call-rpc (defn call-rpc
[method & args] [method & args]
(p/create (promesa/create
(fn [p-resolve p-reject] (fn [p-resolve p-reject]
(rpc-events/call {:method method (rpc-events/call {:method method
:params args :params args

View File

@ -4,7 +4,7 @@
legacy.status-im.events legacy.status-im.events
legacy.status-im.subs.root legacy.status-im.subs.root
[native-module.core :as native-module] [native-module.core :as native-module]
[promesa.core :as p] [promesa.core :as promesa]
status-im.events status-im.events
status-im.navigation.core status-im.navigation.core
status-im.subs.root status-im.subs.root
@ -24,13 +24,13 @@
(deftest wallet-get-derived-addressess-contract-test (deftest wallet-get-derived-addressess-contract-test
(h/test-async :wallet/create-derived-addresses (h/test-async :wallet/create-derived-addresses
(fn [] (fn []
(p/let [sha3-pwd-hash (native-module/sha3 integration-constants/password) (promesa/let [sha3-pwd-hash (native-module/sha3 integration-constants/password)
derivation-path [integration-constants/derivation-path] derivation-path [integration-constants/derivation-path]
accounts (contract-utils/call-rpc "accounts_getAccounts") accounts (contract-utils/call-rpc "accounts_getAccounts")
default-address (contract-utils/get-default-address accounts) default-address (contract-utils/get-default-address accounts)
response (contract-utils/call-rpc response (contract-utils/call-rpc
"wallet_getDerivedAddresses" "wallet_getDerivedAddresses"
sha3-pwd-hash sha3-pwd-hash
default-address default-address
derivation-path)] derivation-path)]
(assert-derived-account response))))) (assert-derived-account response)))))

View File

@ -3,7 +3,7 @@
[cljs.test :refer [deftest is use-fixtures]] [cljs.test :refer [deftest is use-fixtures]]
legacy.status-im.events legacy.status-im.events
legacy.status-im.subs.root legacy.status-im.subs.root
[promesa.core :as p] [promesa.core :as promesa]
[status-im.common.emoji-picker.utils :as emoji-picker.utils] [status-im.common.emoji-picker.utils :as emoji-picker.utils]
[status-im.constants :as constants] [status-im.constants :as constants]
[status-im.contexts.wallet.data-store :as data-store] [status-im.contexts.wallet.data-store :as data-store]
@ -26,7 +26,7 @@
(deftest accounts-get-accounts-contract-test (deftest accounts-get-accounts-contract-test
(h/test-async :contract/accounts-get-accounts (h/test-async :contract/accounts-get-accounts
(fn [] (fn []
(p/let [result (contract-utils/call-rpc "accounts_getAccounts")] (promesa/let [result (contract-utils/call-rpc "accounts_getAccounts")]
(assert-accounts-get-accounts result))))) (assert-accounts-get-accounts result)))))
(defn check-emoji-is-updated (defn check-emoji-is-updated
@ -37,13 +37,13 @@
(deftest accounts-save-accounts-contract (deftest accounts-save-accounts-contract
(h/test-async :contract/accounts-save-account (h/test-async :contract/accounts-save-account
(fn [] (fn []
(p/let [test-emoji (emoji-picker.utils/random-emoji) (promesa/let [test-emoji (emoji-picker.utils/random-emoji)
account (contract-utils/call-rpc "accounts_getAccounts") account (contract-utils/call-rpc "accounts_getAccounts")
default-account (contract-utils/get-default-account account) default-account (contract-utils/get-default-account account)
_ (contract-utils/call-rpc _ (contract-utils/call-rpc
"accounts_saveAccount" "accounts_saveAccount"
(data-store/<-account (merge default-account {:emoji test-emoji}))) (data-store/<-account (merge default-account {:emoji test-emoji})))
accounts (contract-utils/call-rpc "accounts_getAccounts")] accounts (contract-utils/call-rpc "accounts_getAccounts")]
(check-emoji-is-updated test-emoji accounts))))) (check-emoji-is-updated test-emoji accounts)))))
(defn assert-ethereum-chains (defn assert-ethereum-chains
@ -59,7 +59,7 @@
(deftest accounts-get-chains-contract (deftest accounts-get-chains-contract
(h/test-async :contract/wallet_get-ethereum-chains (h/test-async :contract/wallet_get-ethereum-chains
(fn [] (fn []
(p/let [response (contract-utils/call-rpc "wallet_getEthereumChains")] (promesa/let [response (contract-utils/call-rpc "wallet_getEthereumChains")]
(assert-ethereum-chains response))))) (assert-ethereum-chains response)))))
(defn assert-wallet-tokens (defn assert-wallet-tokens
@ -81,11 +81,11 @@
(deftest wallet-get-walet-token-test (deftest wallet-get-walet-token-test
(h/test-async :wallet/get-wallet-token (h/test-async :wallet/get-wallet-token
(fn [] (fn []
(p/let [accounts (contract-utils/call-rpc "accounts_getAccounts") (promesa/let [accounts (contract-utils/call-rpc "accounts_getAccounts")
default-address (contract-utils/get-default-address accounts) default-address (contract-utils/get-default-address accounts)
response (contract-utils/call-rpc response (contract-utils/call-rpc
"wallet_getWalletToken" "wallet_getWalletToken"
[default-address])] [default-address])]
(assert-wallet-tokens response))))) (assert-wallet-tokens response)))))
(defn assert-address-details (defn assert-address-details
@ -98,8 +98,10 @@
(deftest wallet-get-address-details-contract-test (deftest wallet-get-address-details-contract-test
(h/test-async :wallet/get-address-details (h/test-async :wallet/get-address-details
(fn [] (fn []
(p/let [input "test.eth" (promesa/let [input "test.eth"
chain-id constants/ethereum-mainnet-chain-id chain-id constants/ethereum-mainnet-chain-id
ens-address (contract-utils/call-rpc "ens_addressOf" chain-id input) ens-address (contract-utils/call-rpc "ens_addressOf" chain-id input)
response (contract-utils/call-rpc "wallet_getAddressDetails" chain-id ens-address)] response (contract-utils/call-rpc "wallet_getAddressDetails"
chain-id
ens-address)]
(assert-address-details response))))) (assert-address-details response)))))

View File

@ -3,7 +3,7 @@
[cljs.test :refer [deftest is use-fixtures]] [cljs.test :refer [deftest is use-fixtures]]
legacy.status-im.events legacy.status-im.events
legacy.status-im.subs.root legacy.status-im.subs.root
[promesa.core :as p] [promesa.core :as promesa]
[re-frame.core :as rf] [re-frame.core :as rf]
[status-im.constants :as constants] [status-im.constants :as constants]
status-im.events status-im.events
@ -19,7 +19,7 @@
(deftest one-to-one-chat-test (deftest one-to-one-chat-test
(h/test-async ::one-to-one-chat (h/test-async ::one-to-one-chat
(fn [] (fn []
(p/do (promesa/do
(rf/dispatch-sync [:chat.ui/start-chat chat-id]) (rf/dispatch-sync [:chat.ui/start-chat chat-id])
(h/wait-for [:chat/one-to-one-chat-created]) (h/wait-for [:chat/one-to-one-chat-created])
(rf/dispatch-sync [:chat/navigate-to-chat chat-id]) (rf/dispatch-sync [:chat/navigate-to-chat chat-id])
@ -28,7 +28,7 @@
(deftest delete-chat-test (deftest delete-chat-test
(h/test-async ::delete-chat (h/test-async ::delete-chat
(fn [] (fn []
(p/do (promesa/do
(rf/dispatch-sync [:chat.ui/start-chat chat-id]) (rf/dispatch-sync [:chat.ui/start-chat chat-id])
(h/wait-for [:chat/one-to-one-chat-created]) (h/wait-for [:chat/one-to-one-chat-created])
(rf/dispatch-sync [:chat/navigate-to-chat chat-id]) (rf/dispatch-sync [:chat/navigate-to-chat chat-id])
@ -40,7 +40,7 @@
(deftest mute-chat-test (deftest mute-chat-test
(h/test-async ::mute-chat (h/test-async ::mute-chat
(fn [] (fn []
(p/do (promesa/do
(rf/dispatch-sync [:chat.ui/start-chat chat-id]) (rf/dispatch-sync [:chat.ui/start-chat chat-id])
(h/wait-for [:chat/one-to-one-chat-created]) (h/wait-for [:chat/one-to-one-chat-created])
@ -64,7 +64,7 @@
"ed2a86050325bc8856e26898c17e31dee2602b9429c91" "ed2a86050325bc8856e26898c17e31dee2602b9429c91"
"ecf65a41d62ac1f2f0823c0710dcb536e79af2763c") "ecf65a41d62ac1f2f0823c0710dcb536e79af2763c")
primary-name "zQ3...pFNErL"] primary-name "zQ3...pFNErL"]
(p/do (promesa/do
;; Search for contact using compressed key ;; Search for contact using compressed key
(rf/dispatch [:contacts/set-new-identity {:input compressed-key}]) (rf/dispatch [:contacts/set-new-identity {:input compressed-key}])
(h/wait-for [:contacts/set-new-identity-success]) (h/wait-for [:contacts/set-new-identity-success])

View File

@ -1,7 +1,7 @@
(ns tests.integration-test.profile-test (ns tests.integration-test.profile-test
(:require (:require
[cljs.test :refer [deftest is use-fixtures]] [cljs.test :refer [deftest is use-fixtures]]
[promesa.core :as p] [promesa.core :as promesa]
[status-im.contexts.profile.utils :as profile.utils] [status-im.contexts.profile.utils :as profile.utils]
[test-helpers.integration :as h] [test-helpers.integration :as h]
[tests.test-utils :as test-utils] [tests.test-utils :as test-utils]
@ -13,7 +13,7 @@
(h/test-async ::edit-profile-name (h/test-async ::edit-profile-name
(fn [] (fn []
(let [new-name "John Doe"] (let [new-name "John Doe"]
(p/do (promesa/do
(rf/dispatch [:profile/edit-name new-name]) (rf/dispatch [:profile/edit-name new-name])
(h/wait-for [:navigate-back :toasts/upsert]) (h/wait-for [:navigate-back :toasts/upsert])
(let [profile (rf/sub [:profile/profile]) (let [profile (rf/sub [:profile/profile])
@ -25,7 +25,7 @@
(fn [] (fn []
(let [mock-image "resources/images/mock2/monkey.png" (let [mock-image "resources/images/mock2/monkey.png"
absolute-path (.resolve test-utils/path mock-image)] absolute-path (.resolve test-utils/path mock-image)]
(p/do (promesa/do
(rf/dispatch [:profile/edit-picture absolute-path 80 80]) (rf/dispatch [:profile/edit-picture absolute-path 80 80])
(h/wait-for [:profile/update-local-picture :toasts/upsert]) (h/wait-for [:profile/update-local-picture :toasts/upsert])
(let [profile (rf/sub [:profile/profile])] (let [profile (rf/sub [:profile/profile])]
@ -34,7 +34,7 @@
(deftest delete-profile-picture-test (deftest delete-profile-picture-test
(h/test-async ::delete-profile-picture (h/test-async ::delete-profile-picture
(fn [] (fn []
(p/do (promesa/do
(rf/dispatch [:profile/delete-picture]) (rf/dispatch [:profile/delete-picture])
(h/wait-for [:profile/update-local-picture :toasts/upsert]) (h/wait-for [:profile/update-local-picture :toasts/upsert])
(let [profile (rf/sub [:profile/profile])] (let [profile (rf/sub [:profile/profile])]
@ -44,7 +44,7 @@
(h/test-async ::edit-profile-bio (h/test-async ::edit-profile-bio
(fn [] (fn []
(let [new-bio "New bio text"] (let [new-bio "New bio text"]
(p/do (promesa/do
(rf/dispatch [:profile/edit-bio new-bio]) (rf/dispatch [:profile/edit-bio new-bio])
(h/wait-for [:navigate-back :toasts/upsert]) (h/wait-for [:navigate-back :toasts/upsert])
(let [profile (rf/sub [:profile/profile]) (let [profile (rf/sub [:profile/profile])