(defpackage #:hsx-test/renderer (:use #:cl #:fiveam #:hsx #:named-readtables) (:import-from #:mstrings)) (in-package :hsx-test/renderer) (in-readtable mstrings:mstring-syntax) (def-suite renderer-test) (in-suite renderer-test) (test empty-tag (is (string= "
" (render (hsx (div)))))) (test tag-with-props (is (string= "" (render (hsx (div :prop1 "value1" :prop2 t :prop3 nil)))))) (test tag-with-children (is (string= "foo
" (render (hsx (p "foo"))))) (is (string= #M"\ foo \
" (render (hsx (p (span "foo")))))) (is (string= #M"\ foo \ bar \
" (render (hsx (p "foo" (span "bar"))))))) (test tag-with-props-and-children (is (string= "foo
" (render (hsx (p :prop1 "value1" :prop2 t :prop3 nil "foo"))))) (is (string= #M"\ foo \ bar \
" (render (hsx (p :prop1 "value1" :prop2 t :prop3 nil "foo" (span "bar"))))))) (test fragment (let ((frg (hsx (<> (li "bar") (li "baz"))))) (is (string= #M"