|
|
|
@ -4,6 +4,7 @@
|
|
|
|
|
valid?
|
|
|
|
|
render-widgets
|
|
|
|
|
form-hash]]
|
|
|
|
|
[clojure.string :refer [starts-with?]]
|
|
|
|
|
[clojure.spec.alpha :as spec]))
|
|
|
|
|
|
|
|
|
|
(deftest test-form-data
|
|
|
|
@ -69,6 +70,12 @@
|
|
|
|
|
:id "__form-hash"
|
|
|
|
|
:value (form-hash def {})}])
|
|
|
|
|
(rest (render-widgets def {} {}))))))
|
|
|
|
|
(testing "anti-forgery-field is rendered"
|
|
|
|
|
(let [def {:fields {}}]
|
|
|
|
|
(is (starts-with? (first (render-widgets def {} {}))
|
|
|
|
|
(str "<input id=\"__anti-forgery-token\""
|
|
|
|
|
" name=\"__anti-forgery-token\""
|
|
|
|
|
" type=\"hidden\"")))))
|
|
|
|
|
(testing "input is rendered correctly"
|
|
|
|
|
(let [def {:fields {:foo-id {:label "foo-label"
|
|
|
|
|
:widget :input}}}]
|
|
|
|
|