From af83d8c7cdf85b675016eeeecaa85bb547141f4b Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Fri, 26 Sep 2025 19:22:23 +0300 Subject: On second thought it's really not related to templating, just nodes, so moving to nodes ns. --- test/dompa/nodes_test.cljc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'test/dompa/nodes_test.cljc') diff --git a/test/dompa/nodes_test.cljc b/test/dompa/nodes_test.cljc index 55f9394..0e2b63f 100644 --- a/test/dompa/nodes_test.cljc +++ b/test/dompa/nodes_test.cljc @@ -1,2 +1,24 @@ (ns dompa.nodes-test - (:require [clojure.test :refer [deftest is testing]])) + (:require [clojure.test :refer [deftest is testing]] + [dompa.nodes :refer [$]])) + +(deftest node-composition-test + (testing "a simple node" + (is (= {:node/name :div + :node/children [{:node/name :dompa/text + :node/value "hello world"}]} + ($ :div ($ "hello world"))))) + + (testing "a fragment node" + (is (= {:node/name :<> + :node/children [{:node/name :span + :node/children [{:node/name :dompa/text + :node/value "hello"}]} + {:node/name :span + :node/children [{:node/name :dompa/text + :node/value "world"}]}]} + ($ :<> + ($ :span + ($ "hello")) + ($ :span + ($ "world"))))))) -- cgit v1.2.3