Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed May 24, 2024
1 parent 6bcfef4 commit f834ac1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/squint/html_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,15 @@
#(is (= "<div>undefined</div>" %)))
(.catch #(is false "nooooo"))
(.finally done)))))

(deftest html-props-test
(t/async done
(let [js (squint.compiler/compile-string
"(let [m {:a 1 :b 2}] #html [:div {:& m :a 2 :style {:color :red}} \"Hello\"])"
{:repl true :elide-exports true :context :return})
js (str/replace "(async function() { %s } )()" "%s" js)]
(-> (js/eval js)
(.then
#(is (= "<div b=\"2\" a=\"2\" style=\"color:red;\">Hello</div>" %)))
(.catch #(is false "nooooo"))
(.finally done)))))

0 comments on commit f834ac1

Please sign in to comment.