aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/renderers
diff options
context:
space:
mode:
authorMarcin Aman <maman@virtuslab.com>2020-05-31 21:02:46 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-06-09 17:18:17 +0200
commit77c8777b7f66bddd374d68decd507547d356d602 (patch)
treef941a53d1591c56edd454ef40068e831a4ed9d48 /plugins/base/src/test/kotlin/renderers
parent902b670bc764a6db4f49f96d08f2115dd08bdf9b (diff)
downloaddokka-77c8777b7f66bddd374d68decd507547d356d602.tar.gz
dokka-77c8777b7f66bddd374d68decd507547d356d602.tar.bz2
dokka-77c8777b7f66bddd374d68decd507547d356d602.zip
Improve CSS, pages navigation tree and create anchors on page
Diffstat (limited to 'plugins/base/src/test/kotlin/renderers')
-rw-r--r--plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt1
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt26
2 files changed, 13 insertions, 14 deletions
diff --git a/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt b/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt
index f58b0e24..a3bf9188 100644
--- a/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt
+++ b/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt
@@ -90,6 +90,7 @@ fun Element.match(vararg matchers: Any): Unit =
open class Tag(val name: String, vararg val matchers: Any)
class Div(vararg matchers: Any): Tag("div", *matchers)
class P(vararg matchers: Any): Tag("p", *matchers)
+class Span(vararg matchers: Any): Tag("span", *matchers)
private fun Any.accepts(n: Node) {
when (this) {
diff --git a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt
index 54bac755..fa129760 100644
--- a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt
+++ b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt
@@ -6,12 +6,8 @@ import org.jetbrains.dokka.base.renderers.html.HtmlRenderer
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.SourceSetData
import org.jetbrains.dokka.pages.ContentDivergentGroup
-import org.jetbrains.dokka.pages.TextStyle
import org.junit.jupiter.api.Test
-import renderers.Div
-import renderers.RenderingOnlyTestBase
-import renderers.TestPage
-import renderers.match
+import renderers.*
class DivergentTest : RenderingOnlyTestBase() {
private val js = SourceSetData("root", "JS", Platform.js, listOf(SourceRootImpl("pl1")))
@@ -182,10 +178,10 @@ class DivergentTest : RenderingOnlyTestBase() {
HtmlRenderer(context).render(page)
renderedContent.match(
- Div(Div(Div(Div("a")), Div(Div())), "a+",),
- Div(Div(Div(Div("bd")), Div(Div())), "bd+"),
- Div(Div(Div(Div("c")), Div(Div()))),
- Div(Div(Div(Div("e")), Div(Div())), "e+")
+ Div(Div(Span(Div(Div("NATIVE")))), Div(Div(Div("a"))),"a+"),
+ Div(Div(Span(Div(Div("JS")))), Div(Div(Div("bd"))),"bd+"),
+ Div(Div(Span(Div(Div("JVM")))), Div(Div(Div("c")))),
+ Div(Div(Span(Div(Div("NATIVE")))), Div(Div(Div("e"))),"e+"),
)
}
@@ -215,7 +211,10 @@ class DivergentTest : RenderingOnlyTestBase() {
HtmlRenderer(context).render(page)
renderedContent.match(
Div(
- "ab-",
+ Div(
+ "ab-",
+ Span()
+ ),
Div(Div(Div("ab")))
)
)
@@ -283,10 +282,9 @@ class DivergentTest : RenderingOnlyTestBase() {
}
HtmlRenderer(context).render(page)
- val r = renderedContent
renderedContent.match(
Div(
- "ab-",
+ Div("ab-", Span()),
Div(Div(Div("ab"))),
"ab+"
)
@@ -324,8 +322,8 @@ class DivergentTest : RenderingOnlyTestBase() {
HtmlRenderer(context).render(page)
renderedContent.match(
- Div("a-", Div(Div(Div("a")), Div(Div("NATIVE"))), "ab+"),
- Div("b-", Div(Div(Div("b")), Div(Div("NATIVE"))), "ab+")
+ Div(Div("a-", Span()), Div(Div(Div("a"))), "ab+"),
+ Div(Div("b-", Span()), Div(Div(Div(("b")))), "ab+")
)
}
} \ No newline at end of file