diff --git a/test/cljc/hickory/test/select.cljc b/test/cljc/hickory/test/select.cljc index 02e1dca..47474e1 100644 --- a/test/cljc/hickory/test/select.cljc +++ b/test/cljc/hickory/test/select.cljc @@ -230,7 +230,15 @@ (= :h1 (-> selection first :tag))))) (let [selection (select/select (select/find-in-text #"Div") htree)] (is (and (= 1 (count selection)) - (= :div (-> selection first :tag)))))) + (= :div (-> selection first :tag))))) + (let [selection-locs (select/select-locs + (select/child (select/tag :body) + (select/find-in-text #"Paragraph")) + htree) + selection (mapv zip/node selection-locs)] + (is (and (= 1 (count selection)) + (= :p (-> selection first :tag)) + (= :body (-> selection-locs first zip/up zip/node :tag)))))) (let [htree (hickory/as-hickory (hickory/parse html2))] (let [selection (select/select (select/find-in-text #"Paragraph") htree)] (is (and (= 8 (count selection))