aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/content
diff options
context:
space:
mode:
authorVadim Mishenev <vad-mishenev@yandex.ru>2021-12-22 20:03:17 +0300
committerGitHub <noreply@github.com>2021-12-22 20:03:17 +0300
commit9a61f49ac110a3e1e7ecaf6493655b8747d593fa (patch)
treeddece0a9803009e809939e6e99ad1793aa5659d3 /plugins/base/src/test/kotlin/content
parentf7db5033b5bdbbf6ade45b65ca1d6d03893ee8a1 (diff)
downloaddokka-9a61f49ac110a3e1e7ecaf6493655b8747d593fa.tar.gz
dokka-9a61f49ac110a3e1e7ecaf6493655b8747d593fa.tar.bz2
dokka-9a61f49ac110a3e1e7ecaf6493655b8747d593fa.zip
Fix css bugs wih link and table row (#2284)
* Remove extra top margin in paragraph * Remove margin-bottom from platform-hinted * Fix link underlining in table and anchor icon * Make breakable names of constructors * Add test for breakable name of constructor
Diffstat (limited to 'plugins/base/src/test/kotlin/content')
-rw-r--r--plugins/base/src/test/kotlin/content/functions/ContentForConstructors.kt48
1 files changed, 48 insertions, 0 deletions
diff --git a/plugins/base/src/test/kotlin/content/functions/ContentForConstructors.kt b/plugins/base/src/test/kotlin/content/functions/ContentForConstructors.kt
new file mode 100644
index 00000000..832fa6f6
--- /dev/null
+++ b/plugins/base/src/test/kotlin/content/functions/ContentForConstructors.kt
@@ -0,0 +1,48 @@
+package content.functions
+
+import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
+import org.jetbrains.dokka.model.DClass
+import org.jetbrains.dokka.model.dfs
+import org.jetbrains.dokka.pages.*
+import org.junit.jupiter.api.Test
+import utils.assertNotNull
+import kotlin.test.assertEquals
+
+class ContentForConstructors : BaseAbstractTest() {
+ private val testConfiguration = dokkaConfiguration {
+ sourceSets {
+ sourceSet {
+ sourceRoots = listOf("src/")
+ analysisPlatform = "jvm"
+ }
+ }
+ }
+
+ @Test
+ fun `constructor name should have RowTitle style`() {
+ testInline("""
+ |/src/main/kotlin/test/source.kt
+ |package test
+ |
+ |/**
+ | * Dummy text.
+ | */
+ |class Example(val exampleParameter: Int) {
+ |}
+ """.trimIndent(), testConfiguration) {
+ pagesTransformationStage = { module ->
+ val classPage =
+ module.dfs { it.name == "Example" && (it as ContentPage).documentable is DClass } as ContentPage
+ val constructorsTable =
+ classPage.content.dfs { it is ContentTable && it.dci.kind == ContentKind.Constructors } as ContentTable
+
+ assertEquals(1, constructorsTable.children.size)
+ val primary = constructorsTable.children.first()
+ val constructorName =
+ primary.dfs { (it as? ContentText)?.text == "Example" }.assertNotNull("constructorName")
+
+ assert(ContentStyle.RowTitle in constructorName.style)
+ }
+ }
+ }
+} \ No newline at end of file