We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3404b2e commit 2677840Copy full SHA for 2677840
test/cljc/hickory/test/select.cljc
@@ -230,7 +230,15 @@
230
(= :h1 (-> selection first :tag)))))
231
(let [selection (select/select (select/find-in-text #"Div") htree)]
232
(is (and (= 1 (count selection))
233
- (= :div (-> selection first :tag))))))
+ (= :div (-> selection first :tag)))))
234
+ (let [selection-locs (select/select-locs
235
+ (select/child (select/tag :body)
236
+ (select/find-in-text #"Paragraph"))
237
+ htree)
238
+ selection (mapv zip/node selection-locs)]
239
+ (is (and (= 1 (count selection))
240
+ (= :p (-> selection first :tag))
241
+ (= :body (-> selection-locs first zip/up zip/node :tag))))))
242
(let [htree (hickory/as-hickory (hickory/parse html2))]
243
(let [selection (select/select (select/find-in-text #"Paragraph") htree)]
244
(is (and (= 8 (count selection))
0 commit comments