diff options
| author | Asko Nõmm <asko@nmm.ee> | 2025-10-04 17:03:22 +0300 |
|---|---|---|
| committer | Asko Nõmm <asko@nmm.ee> | 2025-10-04 17:03:22 +0300 |
| commit | 3037fdb5c30c7dbbaa7122798ac6328dc43df4ad (patch) | |
| tree | 20fe4f71538b5397d1d6aa52505998c59ab0be34 /test/dompa/html_test.cljc | |
| parent | c8044362b85584f058ffe953a9e6a3087f84a34e (diff) | |
Improve test coverage
Diffstat (limited to 'test/dompa/html_test.cljc')
| -rw-r--r-- | test/dompa/html_test.cljc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/dompa/html_test.cljc b/test/dompa/html_test.cljc index ab2fafd..8565fdc 100644 --- a/test/dompa/html_test.cljc +++ b/test/dompa/html_test.cljc @@ -1,2 +1,17 @@ (ns dompa.html-test - (:require [clojure.test :refer [deftest is testing]])) + (:require [clojure.test :refer [deftest is testing]] + [dompa.html :as html])) + +(deftest coordinates-test + (testing "HTML to coordinates" + (is (= [[0 15] + [5 9]] + (html/->coordinates "<div>hello</div>"))))) + +(deftest nodes-test + (testing "HTML to nodes" + (is (= [{:node/name :div + :node/attrs {} + :node/children [{:node/name :dompa/text + :node/value "hello"}]}] + (html/->nodes "<div>hello</div>"))))) |
