aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt')
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt78
1 files changed, 78 insertions, 0 deletions
diff --git a/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt b/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt
new file mode 100644
index 00000000..c0c03998
--- /dev/null
+++ b/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt
@@ -0,0 +1,78 @@
+package renderers.html
+
+import org.jetbrains.dokka.base.renderers.html.HtmlRenderer
+import org.jetbrains.dokka.pages.TextStyle
+import org.junit.jupiter.api.Test
+import renderers.*
+import utils.Div
+import utils.P
+import utils.match
+
+class GroupWrappingTest : HtmlRenderingOnlyTestBase() {
+
+ @Test
+ fun notWrapped() {
+ val page = TestPage {
+ group {
+ text("a")
+ text("b")
+ }
+ text("c")
+ }
+
+ HtmlRenderer(context).render(page)
+
+ renderedContent.match("abc")
+ }
+
+ @Test
+ fun paragraphWrapped() {
+ val page = TestPage {
+ group(styles = setOf(TextStyle.Paragraph)) {
+ text("a")
+ text("b")
+ }
+ text("c")
+ }
+
+ HtmlRenderer(context).render(page)
+
+ renderedContent.match(P("ab"), "c")
+ }
+
+ @Test
+ fun blockWrapped() {
+ val page = TestPage {
+ group(styles = setOf(TextStyle.Block)) {
+ text("a")
+ text("b")
+ }
+ text("c")
+ }
+
+ HtmlRenderer(context).render(page)
+
+ renderedContent.match(Div("ab"), "c")
+ }
+
+ @Test
+ fun nested() {
+ val page = TestPage {
+ group(styles = setOf(TextStyle.Block)) {
+ text("a")
+ group(styles = setOf(TextStyle.Block)) {
+ group(styles = setOf(TextStyle.Block)) {
+ text("b")
+ text("c")
+ }
+ }
+ text("d")
+ }
+ }
+
+ HtmlRenderer(context).render(page)
+
+ renderedContent.match(Div("a", Div(Div("bc")), "d"))
+ }
+
+}