fix: wallet home loading state (#20297)

* fix: wallet home loading state (#20297)
This commit is contained in:
Omar Basem 2024-06-05 13:21:15 +04:00 committed by GitHub
parent 9445363467
commit 9300377c6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -6,4 +6,5 @@
:selected-networks (set constants/default-network-names)}) :selected-networks (set constants/default-network-names)})
(def defaults (def defaults
{:ui {:network-filter network-filter-defaults}}) {:ui {:network-filter network-filter-defaults
:tokens-loading? true}})

View File

@ -4,7 +4,6 @@
matcher-combinators.test matcher-combinators.test
[status-im.constants :as constants] [status-im.constants :as constants]
[status-im.contexts.wallet.collectible.events :as collectible-events] [status-im.contexts.wallet.collectible.events :as collectible-events]
[status-im.contexts.wallet.db :as db]
[status-im.contexts.wallet.events :as events])) [status-im.contexts.wallet.events :as events]))
(def address "0x2f88d65f3cb52605a54a833ae118fb1363acccd2") (def address "0x2f88d65f3cb52605a54a833ae118fb1363acccd2")
@ -80,7 +79,9 @@
(deftest reset-selected-networks-test (deftest reset-selected-networks-test
(testing "reset-selected-networks" (testing "reset-selected-networks"
(let [db {:wallet {}} (let [db {:wallet {}}
expected-db {:wallet db/defaults} expected-db {:wallet {:ui {:network-filter {:selector-state :default
:selected-networks
(set constants/default-network-names)}}}}
effects (events/reset-selected-networks {:db db}) effects (events/reset-selected-networks {:db db})
result-db (:db effects)] result-db (:db effects)]
(is (match? result-db expected-db))))) (is (match? result-db expected-db)))))
@ -101,7 +102,9 @@
(is (match? result-db expected-db)))) (is (match? result-db expected-db))))
(testing "update-selected-networks > if all networks is already selected, update to incoming network" (testing "update-selected-networks > if all networks is already selected, update to incoming network"
(let [db {:wallet db/defaults} (let [db {:wallet {:ui {:network-filter {:selector-state :default
:selected-networks
(set constants/default-network-names)}}}}
network-name constants/arbitrum-network-name network-name constants/arbitrum-network-name
expected-db {:wallet {:ui {:network-filter {:selected-networks #{network-name} expected-db {:wallet {:ui {:network-filter {:selected-networks #{network-name}
:selector-state :changed}}}} :selector-state :changed}}}}