blob: 77107d120810377ce3789523eb6d9b9ac8da011e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
(ns dompa.html-test
#?(:clj (:require [clojure.test :refer [deftest is testing]]
[dompa.html :as html]))
#?(:cljs (:require [cljs.test :refer-macros [deftest testing is]]
[dompa.html :as html])))
(deftest coordinates-test
(testing "HTML to coordinates"
(is (= {:coordinates [[0 15]
[5 9]]
:html "<div>hello</div>"}
(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>")))))
|