From 089113e352ecd49216602bb1a02fbfada6a40788 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Tue, 7 Apr 2020 16:49:56 +0200 Subject: Fixes tests --- .../kotlin/renderers/html/GroupWrappingTest.kt | 29 +++++++++++++++++++--- .../renderers/html/PlatformDependentHintTest.kt | 8 +++++- 2 files changed, 32 insertions(+), 5 deletions(-) (limited to 'plugins/base/src/test') diff --git a/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt b/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt index eead07a7..da89a352 100644 --- a/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt @@ -1,5 +1,6 @@ package renderers.html +import kotlinx.coroutines.runBlocking import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.pages.TextStyle import org.jsoup.Jsoup @@ -18,7 +19,12 @@ class GroupWrappingTest: RenderingOnlyTestBase() { text("c") } - HtmlRenderer(context).render(page) + runBlocking { + val scope = this + with(HtmlRenderer(context)) { + scope.render(page) + } + } renderedContent.match("abc") } @@ -33,7 +39,12 @@ class GroupWrappingTest: RenderingOnlyTestBase() { text("c") } - HtmlRenderer(context).render(page) + runBlocking { + val scope = this + with(HtmlRenderer(context)) { + scope.render(page) + } + } renderedContent.match(P("ab"), "c") } @@ -48,7 +59,12 @@ class GroupWrappingTest: RenderingOnlyTestBase() { text("c") } - HtmlRenderer(context).render(page) + runBlocking { + val scope = this + with(HtmlRenderer(context)) { + scope.render(page) + } + } renderedContent.match(Div("ab"), "c") } @@ -68,7 +84,12 @@ class GroupWrappingTest: RenderingOnlyTestBase() { } } - HtmlRenderer(context).render(page) + runBlocking { + val scope = this + with(HtmlRenderer(context)) { + scope.render(page) + } + } renderedContent.match(Div("a", Div(Div("bc")), "d")) } diff --git a/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt b/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt index cf1ac0a9..3e603955 100644 --- a/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt @@ -1,5 +1,6 @@ package renderers.html +import kotlinx.coroutines.runBlocking import org.jetbrains.dokka.Platform import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.pages.PlatformData @@ -99,7 +100,12 @@ class PlatformDependentHintTest : RenderingOnlyTestBase() { } } - HtmlRenderer(context).render(page) + runBlocking { + val scope = this + with(HtmlRenderer(context)) { + scope.render(page) + } + } println(renderedContent) renderedContent.match(Div(Div("ab"))) } -- cgit