diff --git a/src/main/cljs/dda/c4k_common/browser.cljs b/src/main/cljs/dda/c4k_common/browser.cljs index 57c854a..b98c836 100644 --- a/src/main/cljs/dda/c4k_common/browser.cljs +++ b/src/main/cljs/dda/c4k_common/browser.cljs @@ -21,7 +21,7 @@ (s/def ::deserializer fn?) (s/def ::optional boolean?) (def dom-function-parameter (s/keys :opt-un [::deserializer ::optional])) -(defn-spec get-content-from-element js-object? +(defn-spec get-content-value-from-element js-object? [name string?] (-> (get-element-by-id name) (.-value))) @@ -36,11 +36,11 @@ :else (apply deserializer [content]))) -(defn-spec get-deserialized-content js-object? +(defn-spec get-content-from-element js-object? [name string? & {:keys [deserializer optional] :or {deserializer identity optional false}} dom-function-parameter] - (-> (get-content-from-element name) + (-> (get-content-value-from-element name) (deserialize-content deserializer optional))) (defn-spec set-validation-result! js-object? diff --git a/src/test/cljs/dda/c4k_common/browser_test.cljs b/src/test/cljs/dda/c4k_common/browser_test.cljs index 57ef8b1..2675e41 100644 --- a/src/test/cljs/dda/c4k_common/browser_test.cljs +++ b/src/test/cljs/dda/c4k_common/browser_test.cljs @@ -8,7 +8,7 @@ (st/instrument `cut/get-element-by-id) (st/instrument `cut/get-content-from-element) (st/instrument `cut/deserialize-content) -(st/instrument `cut/get-deserialized-content) +(st/instrument `cut/get-content-value-from-element) (st/instrument `cut/set-validation-result!) (st/instrument `cut/validate!) (st/instrument `cut/set-output!)