blob: 42543b4c1ae6ec4fda37d777942b0d49cc5a6c29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
(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] [5 9]] (coordinates/compose "<div>hello")))
(is (= [] (coordinates/compose "<div"))))
(testing "Create first-pass coordinates with just text"
(is (= [[0 4]] (coordinates/compose "hello"))))
(testing "Create first-pass coordinates with text starting"
(is (= [[0 4] [5 9] [10 15]] (coordinates/compose "hello<div></div>")))))
|