summaryrefslogtreecommitdiff
path: root/test/dompa/coordinates_test.cljc
diff options
context:
space:
mode:
Diffstat (limited to 'test/dompa/coordinates_test.cljc')
-rw-r--r--test/dompa/coordinates_test.cljc14
1 files changed, 14 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