-
Notifications
You must be signed in to change notification settings - Fork 990
/
Copy pathcomponent_spec.cljs
69 lines (61 loc) · 3.09 KB
/
component_spec.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
(ns quo.components.wallet.keypair.component-spec
(:require
[quo.components.wallet.keypair.view :as keypair]
[test-helpers.component :as h]))
(def ^:private theme :light)
(def accounts
[{:account-props {:customization-color :turquoise
:size 32
:emoji "\uD83C\uDFB2"
:type :default
:name "Trip to Vegas"
:address "0x0ah...71a"}
:networks [{:name :ethereum :short-name "eth"}
{:name :optimism :short-name "opt"}]
:state :default
:action :none}])
(def default-details
{:full-name "John Doe"
:address "zQ3...6fBd2"})
(def other-details {:full-name "Metamask"})
(h/describe "Wallet: Keypair"
(h/test "Default keypair title renders"
(h/render-with-theme-provider [keypair/view
{:accounts accounts
:customization-color :blue
:type :default-keypair
:stored :on-device
:action :selector
:details default-details}]
theme)
(h/is-truthy (h/get-by-label-text :title)))
(h/test "On device renders"
(h/render-with-theme-provider [keypair/view
{:accounts accounts
:customization-color :blue
:type :other
:stored :on-device
:action :selector
:details other-details}]
theme)
(h/is-truthy (h/get-by-label-text :details)))
(h/test "Selector action renders"
(h/render-with-theme-provider [keypair/view
{:accounts accounts
:customization-color :blue
:type :other
:stored :on-keycard
:action :selector
:details other-details}]
theme)
(h/is-truthy (h/get-by-label-text :radio-off)))
(h/test "Options action renders"
(h/render-with-theme-provider [keypair/view
{:accounts accounts
:customization-color :blue
:type :other
:stored :on-keycard
:action :options
:details other-details}]
theme)
(h/is-truthy (h/get-by-label-text :options-button))))