mirror of
https://github.com/penpot/penpot.git
synced 2025-08-04 06:48:33 +02:00
♻️ Refactor internal handling of profile props.
This commit is contained in:
parent
d36bf188ae
commit
9ecbddc18c
4 changed files with 36 additions and 42 deletions
|
@ -177,17 +177,6 @@
|
|||
(t/is (string? token))
|
||||
|
||||
|
||||
;; try register without accepting terms
|
||||
(let [data {::th/type :register-profile
|
||||
:token token
|
||||
:fullname "foobar"
|
||||
:accept-terms-and-privacy false}
|
||||
out (th/mutation! data)]
|
||||
(let [error (:error out)]
|
||||
(t/is (th/ex-info? error))
|
||||
(t/is (th/ex-of-type? error :validation))
|
||||
(t/is (th/ex-of-code? error :invalid-terms-and-privacy))))
|
||||
|
||||
;; try register without token
|
||||
(let [data {::th/type :register-profile
|
||||
:fullname "foobar"
|
||||
|
@ -205,9 +194,7 @@
|
|||
:accept-terms-and-privacy true
|
||||
:accept-newsletter-subscription true}]
|
||||
(let [{:keys [result error]} (th/mutation! data)]
|
||||
(t/is (nil? error))
|
||||
(t/is (true? (get-in result [:props :accept-newsletter-subscription])))
|
||||
(t/is (true? (get-in result [:props :accept-terms-and-privacy])))))
|
||||
(t/is (nil? error))))
|
||||
))
|
||||
|
||||
(t/deftest prepare-register-with-registration-disabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue