From efe84857b95122090eee3283092de390b71da70c Mon Sep 17 00:00:00 2001 From: Juho Teperi Date: Tue, 3 Apr 2018 10:42:25 +0300 Subject: [PATCH] Fix fragment key test case --- test/reagenttest/testreagent.cljs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/reagenttest/testreagent.cljs b/test/reagenttest/testreagent.cljs index ba4316d..ccb6aa2 100644 --- a/test/reagenttest/testreagent.cljs +++ b/test/reagenttest/testreagent.cljs @@ -1138,14 +1138,14 @@ (deftest test-fragments (testing "Fragment as array" - (let [comp (fn [] + (let [comp (fn comp1 [] #js [(r/as-element [:div "hello"]) (r/as-element [:div "world"])])] (is (= "
hello
world
" (as-string [comp]))))) (testing "Fragment element, :<>" - (let [comp (fn [] + (let [comp (fn comp2 [] [:<> [:div "hello"] [:div "world"] @@ -1155,7 +1155,11 @@ (testing "Fragment key" ;; This would cause React warning if both fragements didn't have key set - (let [comp (fn [] + ;; But wont fail the test + (let [children (fn comp4 [] + [:<> + [:div "foo"]]) + comp (fn comp3 [] [:div (list [:<> @@ -1163,7 +1167,6 @@ [:div "hello"] [:div "world"]] ^{:key 2} - [:<> - [:div "foo"]])])] + [children])])] (is (= "
hello
world
foo
" (as-string [comp]))))))