Add test for null component return

This commit is contained in:
Dan Holmsand 2014-09-16 16:31:29 +02:00
parent e19c20d0cc
commit 6ce5bc16f5
1 changed files with 9 additions and 0 deletions

View File

@ -323,3 +323,12 @@
(is (ifn? p1))
(is (= (reagent/partial vector 1 2) p1))
(is (not= p1 (reagent/partial vector 1 3)))))
(deftest test-null-component
(let [null-comp (fn [do-show]
(when do-show
[:div "div in test-null-component"]))]
(is (not (re-find #"test-null-component"
(as-string [null-comp false]))))
(is (re-find #"test-null-component"
(as-string [null-comp true])))))