Skip to content

Commit

Permalink
refactor in favor of h/test-async
Browse files Browse the repository at this point in the history
  • Loading branch information
FFFra committed Mar 13, 2024
1 parent 552d88f commit b04605b
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/tests/contract_test/wallet_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
[accounts]
(first (filter :wallet accounts)))

(defn get-default-account-address
[accounts]
(:address (first accounts)))

(defn check-emoji-is-updated
[test-emoji accounts]
(let [default-account (get-default-account accounts)]
Expand Down Expand Up @@ -99,3 +95,22 @@
main-account
derivation-path)]
(assert-derived-account response)))))

(defn assert-wallet-tokens
[tokens]
(let [flattened-tokens (mapcat val tokens)]
(is (some #(= (:symbol %) "SNT") flattened-tokens))
(is (some #(= (:symbol %) "ETH") flattened-tokens))
(is (some #(= (:symbol %) "DAI") flattened-tokens))))

(deftest wallet-get-walet-token-test
(h/test-async :wallet/get-wallet-token
(fn []
(p/let [_ (h/enable-testnet!)
_ (h/recover-multiaccount!)
accounts (contract-utils/call-rpc "accounts_getAccounts")
main-account (get-main-account accounts)
response (contract-utils/call-rpc
"wallet_getWalletToken"
[main-account])]
(assert-wallet-tokens response)))))

0 comments on commit b04605b

Please sign in to comment.