From 4c8f3bcba59f06a9e8eabe6ac7da8ca976504092 Mon Sep 17 00:00:00 2001 From: Paweł Marks Date: Wed, 18 Mar 2020 19:21:08 +0100 Subject: Fix html renderer tests --- .../renderers/html/PlatformDependentHintTest.kt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt') diff --git a/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt b/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt index f1d50007..f46f8b59 100644 --- a/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt @@ -5,8 +5,10 @@ import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.pages.TextStyle import org.junit.jupiter.api.Test +import renderers.Div import renderers.RenderingOnlyTestBase import renderers.TestPage +import renderers.match class PlatformDependentHintTest : RenderingOnlyTestBase() { private val pl1 = PlatformData("pl1", Platform.js, listOf("pl1")) @@ -24,7 +26,7 @@ class PlatformDependentHintTest : RenderingOnlyTestBase() { } HtmlRenderer(context).render(page) - assert(linesAfterContentTag().contains("
abc
")) + renderedContent.match(Div("abc")) } @Test @@ -38,7 +40,7 @@ class PlatformDependentHintTest : RenderingOnlyTestBase() { } HtmlRenderer(context).render(page) - assert(linesAfterContentTag().contains("
a
[pl1]
b
[pl2]
c
[pl3]")) + renderedContent.match(Div("a"), "[pl1]", Div("b"), "[pl2]", Div("c"), "[pl3]") } @Test @@ -52,7 +54,7 @@ class PlatformDependentHintTest : RenderingOnlyTestBase() { } HtmlRenderer(context).render(page) - assert(linesAfterContentTag().contains("
ab
[pl1]
bc
[pl2]")) + renderedContent.match(Div("ab"), "[pl1]", Div("bc"), "[pl2]") } @Test @@ -66,7 +68,7 @@ class PlatformDependentHintTest : RenderingOnlyTestBase() { } HtmlRenderer(context).render(page) - assert(linesAfterContentTag().contains("
ab
")) + renderedContent.match(Div("ab")) } @Test @@ -82,13 +84,13 @@ class PlatformDependentHintTest : RenderingOnlyTestBase() { } HtmlRenderer(context).render(page) - assert(linesAfterContentTag().contains("
ab
[pl1]
a
b
[pl2]")) + renderedContent.match(Div(Div("ab")), "[pl1]", Div(Div("a"), "b"), "[pl2]") } @Test fun caseWithGroupNotBreakingSimplification() { val page = TestPage { - platformDependentHint(platformData = setOf(pl1, pl2), styles = setOf(TextStyle.Block)) { + platformDependentHint(platformData = setOf(pl1, pl2)) { group { text("a", platformData = setOf(pl1, pl2)) text("b", platformData = setOf(pl1)) @@ -98,7 +100,8 @@ class PlatformDependentHintTest : RenderingOnlyTestBase() { } HtmlRenderer(context).render(page) - assert(linesAfterContentTag().contains("
ab
")) + println(renderedContent) + renderedContent.match("ab") } @Test @@ -112,6 +115,6 @@ class PlatformDependentHintTest : RenderingOnlyTestBase() { } HtmlRenderer(context).render(page) - assert(linesAfterContentTag().contains("
a
[pl1, pl2]
b
[pl3]")) + renderedContent.match(Div("a"), "[pl1, pl2]", Div("b"), "[pl3]") } } \ No newline at end of file -- cgit