From c980ac0c3d19ae94450655afde49d1218d9f0854 Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Thu, 14 Jul 2016 09:34:03 +0200 Subject: [PATCH] Avoid warning messages from React in tests --- test/reagenttest/testreagent.cljs | 19 ++++++++++--------- test/reagenttest/testwrap.cljs | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/test/reagenttest/testreagent.cljs b/test/reagenttest/testreagent.cljs index cc82435..fbc23ca 100644 --- a/test/reagenttest/testreagent.cljs +++ b/test/reagenttest/testreagent.cljs @@ -282,9 +282,10 @@ (as-string [:div {:data-foo "x"}]))) (is (re-find #"aria-foo" (as-string [:div {:aria-foo "x"}]))) - (is (not (re-find #"enctype" - (as-string [:div {"enc-type" "x"}]))) - "Strings are passed through to React.") + ;; Skip test: produces warning in new React + ;; (is (not (re-find #"enctype" + ;; (as-string [:div {"enc-type" "x"}]))) + ;; "Strings are passed through to React.") (is (re-find #"enctype" (as-string [:div {"encType" "x"}])) "Strings are passed through to React, and have to be camelcase.") @@ -576,10 +577,10 @@ comps (atom {}) c1 (fn [] (swap! comps assoc :c1 (r/current-component)) - [:p (swap! v update-in [:v1] inc)]) + [:p "" (swap! v update-in [:v1] inc)]) c2 (fn [] (swap! comps assoc :c2 (r/current-component)) - [:div (swap! v update-in [:v2] inc) + [:div "" (swap! v update-in [:v2] inc) [c1]]) state (r/atom 0) spy (r/atom 0) @@ -587,7 +588,7 @@ t1 (fn [] @(r/track t)) c3 (fn [] (swap! comps assoc :c3 (r/current-component)) - [:div (reset! spy @(r/track t1))])] + [:div "" (reset! spy @(r/track t1))])] (with-mounted-component [c2] (fn [c div] (is (= @v {:v1 1 :v2 1})) @@ -705,10 +706,10 @@ render (fn [& args] (this-as c (is (= c (r/current-component)))) (add-args :render args) - [:div (first args)]) + [:div "" (first args)]) render2 (fn [& args] (add-args :render args) - [:div (first args)]) + [:div "" (first args)]) ls {:get-initial-state (fn [& args] (reset! t (first args)) @@ -806,7 +807,7 @@ (is (= (first args) (r/props c))) (add-args :render {:children (r/children c)}) - [:div (first args)])) + [:div "" (first args)])) ls {:get-initial-state (fn [& args] (reset! t (first args)) diff --git a/test/reagenttest/testwrap.cljs b/test/reagenttest/testwrap.cljs index 1913a6d..59b6cdc 100644 --- a/test/reagenttest/testwrap.cljs +++ b/test/reagenttest/testwrap.cljs @@ -181,7 +181,7 @@ b-count (r/atom 0) derefer (fn derefer [cur count] (swap! count inc) - [:div @cur]) + [:div "" @cur]) comp (fn test-cursor [] [:div [derefer (r/cursor state [:a]) a-count] @@ -215,7 +215,7 @@ a-count (r/atom 0) b-count (r/atom 0) derefer (fn derefer [cur count] - [:div @cur]) + [:div "" @cur]) f (fn [[x y]] (swap! y inc) (get-in @statec x)) ac (r/cursor f [[:a] a-count]) bc (r/cursor f [[:b] b-count])