aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/renderers
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2021-08-25 09:41:01 +0200
committerMarcin Aman <marcin.aman@gmail.com>2021-08-25 09:41:01 +0200
commit3d416fec95e741289b02bf4a4b2e0fdf06de0aea (patch)
treee65f0a0a84c3a380d8d20f7ee5bd7f1ec05100bb /plugins/base/src/test/kotlin/renderers
parent9044761979d08b3b116c9f8416dfb42ae216898c (diff)
downloaddokka-3d416fec95e741289b02bf4a4b2e0fdf06de0aea.tar.gz
dokka-3d416fec95e741289b02bf4a4b2e0fdf06de0aea.tar.bz2
dokka-3d416fec95e741289b02bf4a4b2e0fdf06de0aea.zip
Fix breakable labels and icon on single module project
Diffstat (limited to 'plugins/base/src/test/kotlin/renderers')
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/FormattingUtilsTest.kt38
1 files changed, 37 insertions, 1 deletions
diff --git a/plugins/base/src/test/kotlin/renderers/html/FormattingUtilsTest.kt b/plugins/base/src/test/kotlin/renderers/html/FormattingUtilsTest.kt
index fa1e30f6..c77a78fb 100644
--- a/plugins/base/src/test/kotlin/renderers/html/FormattingUtilsTest.kt
+++ b/plugins/base/src/test/kotlin/renderers/html/FormattingUtilsTest.kt
@@ -31,7 +31,43 @@ class FormattingUtilsTest {
val testedText = "Package org.jetbrains.dokka.it.moduleC"
val expectedHtml = """
<html>
- <body><span>Package</span><wbr></wbr> <span>org.</span><wbr></wbr><span>jetbrains.</span><wbr></wbr><span>dokka.</span><wbr></wbr><span>it.</span><wbr></wbr><span>moduleC</span></body>
+ <body><span><span>Package</span></span> <span>org.</span><wbr></wbr><span>jetbrains.</span><wbr></wbr><span>dokka.</span><wbr></wbr><span>it.</span><wbr></wbr><span>moduleC</span></body>
+ </html>
+ """.trimIndent()
+
+ val html = createHTML(prettyPrint = true).html {
+ body {
+ buildBreakableText(testedText)
+ }
+ }
+
+ assertEquals(expectedHtml.trim(), html.trim())
+ }
+
+ @Test
+ fun `should build breakable text for text with braces`(){
+ val testedText = "[Common]kotlinx.collections.immutable"
+ val expectedHtml = """
+ <html>
+ <body><span>[Common]kotlinx.</span><wbr></wbr><span>collections.</span><wbr></wbr><span>immutable</span></body>
+ </html>
+ """.trimIndent()
+
+ val html = createHTML(prettyPrint = true).html {
+ body {
+ buildBreakableText(testedText)
+ }
+ }
+
+ assertEquals(expectedHtml.trim(), html.trim())
+ }
+
+ @Test
+ fun `should build breakable text for camel case notation`(){
+ val testedText = "DokkkkkkkaIsTheBest"
+ val expectedHtml = """
+ <html>
+ <body><span>Dokkkkkkka</span><wbr></wbr><span>Is</span><wbr></wbr><span>The</span><wbr></wbr><span><span>Best</span></span></body>
</html>
""".trimIndent()