Permalink
Browse files

add failing test-case for nil data

  • Loading branch information...
aiba committed Mar 2, 2013
1 parent fe2d909 commit 2f17d6cfb685807351047d4697943c1fe0fd1303
Showing with 9 additions and 0 deletions.
  1. +9 −0 test/dommy/template_test.cljs
@@ -120,3 +120,12 @@
(deftest nested-deftemplate
(is= "<ul class=\"class1\"><li>0</li><li>1</li><li>2</li><li>3</li><li>4</li></ul>"
(.-outerHTML (nested-template 5))))
+
+(deftest nil-in-template
+ (is= "<span></span>"
+ (.-outerHTML (template/node [:span nil])))
+ (is= "<ul><li>0</li><li>2</li></ul>"
+ (.-outerHTML (template/node [:ul (for [i (range 3)]
+ (when (even? i)
+ [:li i]))]))))
+

0 comments on commit 2f17d6c

Please sign in to comment.