chore: add spec test for keycard component (#15920)
This commit is contained in:
parent
62945205a0
commit
77ddd8688f
|
@ -1,20 +1,11 @@
|
|||
(ns quo2.components.keycard.component-spec
|
||||
(:require [quo2.components.keycard.view :as keycard]
|
||||
[test-helpers.component :as h]
|
||||
[utils.i18n :as i18n]))
|
||||
[test-helpers.component :as h]))
|
||||
|
||||
(h/describe "keycard component"
|
||||
(h/test "Render of keycard component when: Status = Empty, Locked = False"
|
||||
(h/test "Render of keycard component when: holder-name prop is not set"
|
||||
(h/render [keycard/keycard])
|
||||
(-> (h/expect (h/query-by-label-text :holder-name))
|
||||
(h/is-equal (i18n/label :t/empty-keycard))))
|
||||
|
||||
(h/test "Render of keycard component when: Status = Filled, Locked = False"
|
||||
(h/render [keycard/keycard {:holder-name? "Alisha"}])
|
||||
(-> (h/expect (h/query-by-label-text :holder-name))
|
||||
(h/is-equal (i18n/label :t/user-keycard {:name :holder-name}))))
|
||||
|
||||
(h/test "Render of keycard component when: Status = Filled, Locked = True"
|
||||
(h/render [keycard/keycard {:holder-name? "Alisha"}])
|
||||
(-> (h/expect (h/query-by-label-text :holder-name))
|
||||
(h/is-equal (i18n/label :t/user-keycard {:name :holder-name})))))
|
||||
(h/is-truthy (h/get-by-translation-text :empty-keycard)))
|
||||
(h/test "Render of keycard component when: holder-name prop is set"
|
||||
(h/render [keycard/keycard {:holder-name "Alisha"}])
|
||||
(h/is-truthy (h/get-by-translation-text :user-keycard))))
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
[quo2.components.drawers.drawer-buttons.component-spec]
|
||||
[quo2.components.drawers.permission-context.component-spec]
|
||||
[quo2.components.inputs.input.component-spec]
|
||||
[quo2.components.keycard.component-spec]
|
||||
[quo2.components.inputs.profile-input.component-spec]
|
||||
[quo2.components.inputs.recovery-phrase.component-spec]
|
||||
[quo2.components.inputs.title-input.component-spec]
|
||||
|
|
|
@ -188,6 +188,10 @@
|
|||
[element]
|
||||
(.toBeTruthy (js/expect element)))
|
||||
|
||||
(defn is-falsy
|
||||
[element]
|
||||
(.toBeFalsy (js/expect element)))
|
||||
|
||||
(defn is-null
|
||||
[element]
|
||||
(.toBeNull (js/expect element)))
|
||||
|
|
Loading…
Reference in New Issue