Skip to content

Commit

Permalink
Added test for last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
danisty authored and christian-draeger committed Nov 29, 2023
1 parent 8e1d6de commit 46b2329
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions html-parser/src/test/kotlin/it/skrape/selects/DocElementKtTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -697,4 +697,24 @@ class DocElementKtTest {
fun `can convert DocElement to jsoup element`() {
expectThat(aValidElement.element).isA<Element>()
}


@Test
fun `children, parents, siblings and allElements of relaxed element are also relaxed`() {
htmlDocument("<div><a>skrape.it</a></div><div>sibling</div>") {
findFirst("div") {
expectThat(
children[0].relaxed || parents[0].relaxed || siblings[0].relaxed || allElements[0].relaxed
).isEqualTo(false)
}

relaxed = true

findFirst("div") {
expectThat(
children[0].relaxed && parents[0].relaxed && siblings[0].relaxed && allElements[0].relaxed
).isEqualTo(true)
}
}
}
}

0 comments on commit 46b2329

Please sign in to comment.