mirror of
https://github.com/status-im/reagent.git
synced 2025-02-06 00:54:21 +00:00
4a8ac5cd83
Custom HTML element property name code accidentally modified cache object for normal HTML elements, which can cause Reagent to lose correct mappings for properties like className, htmlFor and charSet.
21 lines
781 B
Clojure
21 lines
781 B
Clojure
(ns reagent.impl.template-test
|
|
(:require [clojure.test :as t :refer [deftest is testing]]
|
|
[reagent.impl.template :as tmpl]
|
|
[goog.object :as gobj]))
|
|
|
|
(deftest cached-prop-name
|
|
(is (= "className"
|
|
(tmpl/cached-prop-name :class))))
|
|
|
|
(deftest cached-custom-prop-name
|
|
(is (= "class"
|
|
(tmpl/cached-custom-prop-name :class))))
|
|
|
|
(deftest convert-props-test
|
|
(is (gobj/equals #js {:className "a"}
|
|
(tmpl/convert-props {:class "a"} #js {:id nil :custom false})))
|
|
(is (gobj/equals #js {:class "a"}
|
|
(tmpl/convert-props {:class "a"} #js {:id nil :custom true})))
|
|
(is (gobj/equals #js {:className "a b" :id "a"}
|
|
(tmpl/convert-props {:class "b"} #js {:id "a" :class "a" :custom false}))))
|