fix required attribute to be boolean

integration-tests
Josha von Gizycki 6 years ago
parent 86ceeca960
commit 503711460f

@ -87,7 +87,7 @@
(when (and validate? (not (spec/valid? spec req-value))) (when (and validate? (not (spec/valid? spec req-value)))
(spec-to-errmsg label spec req-value)) (spec-to-errmsg label spec req-value))
(hform/label id label) (hform/label id label)
(hform/text-field {:required (when required "required")} (hform/text-field {:required (or required false)}
id id
(if validate? req-value value)))) (if validate? req-value value))))
@ -109,7 +109,7 @@
(when (and validate? (not (spec/valid? spec req-value))) (when (and validate? (not (spec/valid? spec req-value)))
(spec-to-errmsg label spec value)) (spec-to-errmsg label spec value))
(hform/label id label) (hform/label id label)
(hform/text-area {:required (when required "required")} (hform/text-area {:required (or required false)}
id id
(if validate? req-value value)))) (if validate? req-value value))))

@ -83,7 +83,7 @@
[:label {:for "foo-id"} "foo-label"] [:label {:for "foo-id"} "foo-label"]
[:input {:id "foo-id" [:input {:id "foo-id"
:name "foo-id" :name "foo-id"
:required nil :required false
:type "text" :type "text"
:value nil}]) :value nil}])
(first (first
@ -97,7 +97,7 @@
[:label {:for "foo-id"} "foo-label"] [:label {:for "foo-id"} "foo-label"]
[:input {:id "foo-id" [:input {:id "foo-id"
:name "foo-id" :name "foo-id"
:required "required" :required true
:type "text" :type "text"
:value nil}]) :value nil}])
(first (first
@ -111,7 +111,7 @@
[:label {:for "foo-id"} "foo-label"] [:label {:for "foo-id"} "foo-label"]
[:input {:id "foo-id" [:input {:id "foo-id"
:name "foo-id" :name "foo-id"
:required "required" :required true
:type "text" :type "text"
:value nil}]) :value nil}])
(first (first
@ -153,7 +153,7 @@
[:label {:for "foo-id"} "foo-label"] [:label {:for "foo-id"} "foo-label"]
[:textarea {:id "foo-id" [:textarea {:id "foo-id"
:name "foo-id" :name "foo-id"
:required nil} :required false}
""]) ""])
(first (first
(nthrest (nthrest
@ -166,7 +166,7 @@
[:label {:for "foo-id"} "foo-label"] [:label {:for "foo-id"} "foo-label"]
[:textarea {:id "foo-id" [:textarea {:id "foo-id"
:name "foo-id" :name "foo-id"
:required "required"} :required true}
""]) ""])
(first (first
(nthrest (nthrest

Loading…
Cancel
Save