summaryrefslogtreecommitdiff
path: root/test/dompa
diff options
context:
space:
mode:
Diffstat (limited to 'test/dompa')
-rw-r--r--test/dompa/coordinates_test.cljc14
-rw-r--r--test/dompa/html_test.cljc2
-rw-r--r--test/dompa/nodes_test.cljc2
-rw-r--r--test/dompa/utils_test.cljc2
4 files changed, 20 insertions, 0 deletions
diff --git a/test/dompa/coordinates_test.cljc b/test/dompa/coordinates_test.cljc
new file mode 100644
index 0000000..efa6df5
--- /dev/null
+++ b/test/dompa/coordinates_test.cljc
@@ -0,0 +1,14 @@
+(ns dompa.coordinates-test
+ (:require [clojure.test :refer [deftest testing is]]
+ [dompa.coordinates :as coordinates]))
+
+(deftest compose-test
+ (testing "Create first-pass coordinates"
+ (is (= [[0 4] [5 9] [10 15]] (coordinates/compose "<div>hello</div>"))))
+
+ (testing "Create first-pass coordinates with invalid HTML"
+ (is (= [[0 4]] (coordinates/compose "<div>hello")))
+ (is (= [] (coordinates/compose "<div"))))
+
+ (testing "Create first-pass coordinates with just text"
+ (is (= [[0 4]] (coordinates/compose "hello"))))) \ No newline at end of file
diff --git a/test/dompa/html_test.cljc b/test/dompa/html_test.cljc
new file mode 100644
index 0000000..ab2fafd
--- /dev/null
+++ b/test/dompa/html_test.cljc
@@ -0,0 +1,2 @@
+(ns dompa.html-test
+ (:require [clojure.test :refer [deftest is testing]]))
diff --git a/test/dompa/nodes_test.cljc b/test/dompa/nodes_test.cljc
new file mode 100644
index 0000000..55f9394
--- /dev/null
+++ b/test/dompa/nodes_test.cljc
@@ -0,0 +1,2 @@
+(ns dompa.nodes-test
+ (:require [clojure.test :refer [deftest is testing]]))
diff --git a/test/dompa/utils_test.cljc b/test/dompa/utils_test.cljc
new file mode 100644
index 0000000..9d0ddf3
--- /dev/null
+++ b/test/dompa/utils_test.cljc
@@ -0,0 +1,2 @@
+(ns dompa.utils-test
+ (:require [clojure.test :refer [deftest is testing]]))