|
20 | 20 | (h/fire-event :on-focus (h/get-by-label-text :address-text-input))
|
21 | 21 | (h/has-prop (h/get-by-label-text :address-text-input)
|
22 | 22 | :placeholder-text-color
|
23 |
| - colors/neutral-40))) |
| 23 | + colors/neutral-30))) |
24 | 24 |
|
25 | 25 | (h/test "on focus with blur? true"
|
26 | 26 | (with-redefs [clipboard/get-string #(% "")]
|
|
30 | 30 | (h/fire-event :on-focus (h/get-by-label-text :address-text-input))
|
31 | 31 | (h/has-prop (h/get-by-label-text :address-text-input)
|
32 | 32 | :placeholder-text-color
|
33 |
| - colors/neutral-80-opa-40))) |
| 33 | + colors/neutral-80-opa-20))) |
34 | 34 |
|
35 |
| - (h/test "scanned value is properly set" |
36 |
| - (let [on-change-text (h/mock-fn) |
37 |
| - scanned-value "scanned-value"] |
| 35 | + (h/test "default value is properly set" |
| 36 | + (let [default-value "default-value"] |
38 | 37 | (with-redefs [clipboard/get-string #(% "")]
|
39 | 38 | (h/render [address-input/address-input
|
40 |
| - {:scanned-value scanned-value |
41 |
| - :on-change-text on-change-text |
42 |
| - :ens-regex ens-regex}]) |
43 |
| - (-> (h/wait-for #(h/get-by-label-text :clear-button)) |
44 |
| - (.then (fn [] |
45 |
| - (h/was-called-with on-change-text scanned-value) |
46 |
| - (h/has-prop (h/get-by-label-text :address-text-input) |
47 |
| - :default-value |
48 |
| - scanned-value))))))) |
| 39 | + {:default-value default-value |
| 40 | + :ens-regex ens-regex}]) |
| 41 | + (h/has-prop (h/get-by-label-text :address-text-input) |
| 42 | + :value |
| 43 | + default-value)))) |
49 | 44 |
|
50 | 45 | (h/test "clear icon is shown when input has text"
|
51 | 46 | (with-redefs [clipboard/get-string #(% "")]
|
52 | 47 | (h/render [address-input/address-input
|
53 |
| - {:scanned-value "scanned value" |
| 48 | + {:default-value "default value" |
54 | 49 | :ens-regex ens-regex}])
|
55 | 50 | (-> (h/wait-for #(h/get-by-label-text :clear-button-container))
|
56 | 51 | (.then #(h/is-truthy (h/get-by-label-text :clear-button))))))
|
57 | 52 |
|
58 | 53 | (h/test "on blur with text and blur? false"
|
59 | 54 | (with-redefs [clipboard/get-string #(% "")]
|
60 | 55 | (h/render [address-input/address-input
|
61 |
| - {:scanned-value "scanned value" |
| 56 | + {:default-value "default value" |
62 | 57 | :ens-regex ens-regex}])
|
63 | 58 | (-> (h/wait-for #(h/get-by-label-text :clear-button))
|
64 | 59 | (.then (fn []
|
|
71 | 66 | (h/test "on blur with text blur? true"
|
72 | 67 | (with-redefs [clipboard/get-string #(% "")]
|
73 | 68 | (h/render [address-input/address-input
|
74 |
| - {:scanned-value "scanned value" |
| 69 | + {:default-value "default value" |
75 | 70 | :blur? true
|
76 | 71 | :ens-regex ens-regex}])
|
77 | 72 | (-> (h/wait-for #(h/get-by-label-text :clear-button))
|
|
106 | 101 | (let [on-clear (h/mock-fn)]
|
107 | 102 | (with-redefs [clipboard/get-string #(% "")]
|
108 | 103 | (h/render [address-input/address-input
|
109 |
| - {:scanned-value "scanned value" |
| 104 | + {:default-value "default value" |
110 | 105 | :on-clear on-clear
|
111 | 106 | :ens-regex ens-regex}])
|
112 | 107 | (-> (h/wait-for #(h/get-by-label-text :clear-button))
|
|
148 | 143 | (-> (h/wait-for #(h/get-by-label-text :clear-button))
|
149 | 144 | (.then (fn []
|
150 | 145 | (h/has-prop (h/get-by-label-text :address-text-input)
|
151 |
| - :default-value |
| 146 | + :value |
152 | 147 | clipboard)))))))
|
153 | 148 |
|
154 | 149 | (h/test "ENS loading state and call on-detect-ens"
|
|
0 commit comments