diff --git a/test/reagenttest/testreagent.cljs b/test/reagenttest/testreagent.cljs index 70d41be..0404494 100644 --- a/test/reagenttest/testreagent.cljs +++ b/test/reagenttest/testreagent.cljs @@ -27,6 +27,9 @@ (def rflush r/flush) +(defn rstr [react-elem] + (server/render-to-static-markup react-elem)) + (deftest really-simple-test (when (and isClient (not (:really-simple-test @tests-done))) @@ -347,15 +350,12 @@ (deftest test-static-markup (is (= "
foo
" - (server/render-to-static-markup - [:div "foo"]))) + (rstr [:div "foo"]))) (is (= "

foo

" - (server/render-to-static-markup - [:div.bar [:p "foo"]]))) + (rstr [:div.bar [:p "foo"]]))) (is (= "

foobar

" - (server/render-to-static-markup - [:div.bar {:dangerously-set-inner-HTML - {:__html "

foobar

"}} ])))) + (rstr [:div.bar {:dangerously-set-inner-HTML + {:__html "

foobar

"}} ])))) (deftest test-return-class (when isClient @@ -417,9 +417,6 @@ (is (= 1 @top-ran)) (is (= 4 @ran))))))) -(defn rstr [react-elem] - (server/render-to-static-markup react-elem)) - (deftest test-create-element (let [ae r/as-element ce r/create-element] @@ -1075,29 +1072,24 @@ (deftest style-property-names-are-camel-cased (is (re-find #"
foo
" - (server/render-to-static-markup - [:div {:style {:text-align "center"}} "foo"])))) + (rstr [:div {:style {:text-align "center"}} "foo"])))) (deftest custom-element-class-prop (is (re-find #"foo" - (server/render-to-static-markup - [:custom-element {:class "foobar"} "foo"]))) + (rstr [:custom-element {:class "foobar"} "foo"]))) (is (re-find #"foo" - (server/render-to-static-markup - [:custom-element.foobar "foo"])))) + (rstr [:custom-element.foobar "foo"])))) (deftest html-entities (testing "entity numbers can be unescaped always" (is (= " " - (server/render-to-static-markup - [:i (gstr/unescapeEntities " ")])))) + (rstr [:i (gstr/unescapeEntities " ")])))) (when r/is-client (testing "When DOM is available, all named entities can be unescaped" (is (= " " - (server/render-to-static-markup - [:i (gstr/unescapeEntities " ")])))))) + (rstr [:i (gstr/unescapeEntities " ")])))))) (defn context-wrapper [] (r/create-class