From 46b23292219f70f14eddd16c0b0e2a72a65be979 Mon Sep 17 00:00:00 2001 From: Danisty Date: Wed, 19 Jul 2023 00:10:59 +0200 Subject: [PATCH] Added test for last commit --- .../it/skrape/selects/DocElementKtTest.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/html-parser/src/test/kotlin/it/skrape/selects/DocElementKtTest.kt b/html-parser/src/test/kotlin/it/skrape/selects/DocElementKtTest.kt index 105545a3..45ddc8a9 100644 --- a/html-parser/src/test/kotlin/it/skrape/selects/DocElementKtTest.kt +++ b/html-parser/src/test/kotlin/it/skrape/selects/DocElementKtTest.kt @@ -697,4 +697,24 @@ class DocElementKtTest { fun `can convert DocElement to jsoup element`() { expectThat(aValidElement.element).isA() } + + + @Test + fun `children, parents, siblings and allElements of relaxed element are also relaxed`() { + htmlDocument("
skrape.it
sibling
") { + 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) + } + } + } } \ No newline at end of file