diff options
| author | Asko Nõmm <asko@nmm.ee> | 2025-10-19 15:38:55 +0300 |
|---|---|---|
| committer | Asko Nõmm <asko@nmm.ee> | 2025-10-19 15:38:55 +0300 |
| commit | e3519291b23972f1857bbee5092ffd34eea6cc71 (patch) | |
| tree | 21a5baa15b8636c778042001f0fdc21cba1c0f41 /test | |
| parent | 3a8a9cf2bc4d775153ce5fd0a00645c49384c46e (diff) | |
Fix an issue where a sequence of nodes created with the `$` helper would break.
Diffstat (limited to 'test')
| -rw-r--r-- | test/dompa/nodes_test.cljc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/dompa/nodes_test.cljc b/test/dompa/nodes_test.cljc index 8d39da1..2606be6 100644 --- a/test/dompa/nodes_test.cljc +++ b/test/dompa/nodes_test.cljc @@ -14,6 +14,17 @@ (is (= "<div>hello world</div>" (hello "world")))) +(defhtml list-items [items] + ($ :ul + (->> items + (map (fn [item] + ($ :li ($ item)))) + (into [])))) + +(deftest list-items-test + (is (= "<ul><li>one</li><li>two</li><li>three</li></ul>" + (list-items ["one" "two" "three"])))) + (deftest $-test (testing "a simple node" (is (= {:node/name :div |
