Hide key storage selection screen temporarily
Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
This commit is contained in:
parent
0d78e71ece
commit
8764fafc42
|
@ -38,11 +38,17 @@
|
||||||
|
|
||||||
(defn dec-step [step]
|
(defn dec-step [step]
|
||||||
(let [inverted (map-invert step-kw-to-num)]
|
(let [inverted (map-invert step-kw-to-num)]
|
||||||
(inverted (dec (step-kw-to-num step)))))
|
; Skip select-key-storage step
|
||||||
|
(if (= step :create-code)
|
||||||
|
:choose-key
|
||||||
|
(inverted (dec (step-kw-to-num step))))))
|
||||||
|
|
||||||
(defn inc-step [step]
|
(defn inc-step [step]
|
||||||
(let [inverted (map-invert step-kw-to-num)]
|
(let [inverted (map-invert step-kw-to-num)]
|
||||||
(inverted (inc (step-kw-to-num step)))))
|
; Skip select-key-storage step
|
||||||
|
(if (= step :choose-key)
|
||||||
|
:create-code
|
||||||
|
(inverted (inc (step-kw-to-num step))))))
|
||||||
|
|
||||||
(defn get-status [cofx]
|
(defn get-status [cofx]
|
||||||
(assoc cofx :status (rand-nth statuses/data)))
|
(assoc cofx :status (rand-nth statuses/data)))
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
(testing "Back from create-code"
|
(testing "Back from create-code"
|
||||||
(let [db {:intro-wizard {:step :create-code :key-code "qwerty"}}
|
(let [db {:intro-wizard {:step :create-code :key-code "qwerty"}}
|
||||||
result (get-in (models/intro-step-back {:db db}) [:db :intro-wizard])]
|
result (get-in (models/intro-step-back {:db db}) [:db :intro-wizard])]
|
||||||
(is (= result {:step :select-key-storage :key-code nil :weak-password? true}))))
|
(is (= result {:step :choose-key :key-code nil :weak-password? true}))))
|
||||||
|
|
||||||
(testing "Back from confirm-code"
|
(testing "Back from confirm-code"
|
||||||
(let [db {:intro-wizard {:step :confirm-code :confirm-failure? true}}
|
(let [db {:intro-wizard {:step :confirm-code :confirm-failure? true}}
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
;; In this case intro-step-forward returns fx/merge result which is an fn
|
;; In this case intro-step-forward returns fx/merge result which is an fn
|
||||||
;; to be invoked on cofx
|
;; to be invoked on cofx
|
||||||
result (get-in ((models/intro-step-forward {:db db}) {:db db}) [:db :intro-wizard])]
|
result (get-in ((models/intro-step-forward {:db db}) {:db db}) [:db :intro-wizard])]
|
||||||
(is (= result {:step :select-key-storage}))))
|
(is (= result {:step :create-code}))))
|
||||||
|
|
||||||
(testing "Forward from generate-key"
|
(testing "Forward from generate-key"
|
||||||
(let [db {:intro-wizard {:step :generate-key}}
|
(let [db {:intro-wizard {:step :generate-key}}
|
||||||
|
|
Loading…
Reference in New Issue