summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAsko Nõmm <asko@nmm.ee>2025-09-14 14:51:29 +0300
committerAsko Nõmm <asko@nmm.ee>2025-09-14 14:51:29 +0300
commited2cf33c61816d6dd41cd2133ebcf0aa62a28e01 (patch)
treec55b0d7a05c937818e9917875f04e358d0b387e2 /test
parent37b555f71ea6ebaea9ff183f186abc46cf9b1a67 (diff)
Fix issue where a text node coordinate would not be created if it's the only node in text.
Diffstat (limited to 'test')
-rw-r--r--test/dompa/coordinates_test.cljc7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/dompa/coordinates_test.cljc b/test/dompa/coordinates_test.cljc
index efa6df5..42543b4 100644
--- a/test/dompa/coordinates_test.cljc
+++ b/test/dompa/coordinates_test.cljc
@@ -7,8 +7,11 @@
(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 (= [[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"))))) \ No newline at end of file
+ (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>"))))) \ No newline at end of file