aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-05-31 13:53:07 +0200
committerGitHub <noreply@github.com>2023-05-31 13:53:07 +0200
commit63bed7cb2e47eb46772e680982c33ed3ee624c31 (patch)
tree3355f5c18c9d755caffa6f2fb6ca24a2f91a1acc /plugins/base/src/test
parentf45750699d089e0101dcde5d38c7e08ec2f03708 (diff)
downloaddokka-63bed7cb2e47eb46772e680982c33ed3ee624c31.tar.gz
dokka-63bed7cb2e47eb46772e680982c33ed3ee624c31.tar.bz2
dokka-63bed7cb2e47eb46772e680982c33ed3ee624c31.zip
Fix missing tab entries for module names with space (#3019)
Diffstat (limited to 'plugins/base/src/test')
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/SourceSetFilterTest.kt64
1 files changed, 64 insertions, 0 deletions
diff --git a/plugins/base/src/test/kotlin/renderers/html/SourceSetFilterTest.kt b/plugins/base/src/test/kotlin/renderers/html/SourceSetFilterTest.kt
new file mode 100644
index 00000000..e6155535
--- /dev/null
+++ b/plugins/base/src/test/kotlin/renderers/html/SourceSetFilterTest.kt
@@ -0,0 +1,64 @@
+package renderers.html
+
+import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
+import org.junit.jupiter.api.Assertions.assertEquals
+import org.junit.jupiter.api.Test
+import signatures.renderedContent
+import utils.TestOutputWriterPlugin
+
+class SourceSetFilterTest : BaseAbstractTest() {
+
+ @Test // see #3011
+ fun `should separate multiple data-filterable attribute values with comma`() {
+ val configuration = dokkaConfiguration {
+ moduleName = "Dokka Module"
+
+ sourceSets {
+ val common = sourceSet {
+ name = "common"
+ displayName = "common"
+ analysisPlatform = "common"
+ sourceRoots = listOf("src/commonMain/kotlin/testing/Test.kt")
+ }
+ sourceSet {
+ name = "jvm"
+ displayName = "jvm"
+ analysisPlatform = "jvm"
+ dependentSourceSets = setOf(common.value.sourceSetID)
+ sourceRoots = listOf("src/jvmMain/kotlin/testing/Test.kt")
+ }
+ }
+ }
+
+ val source = """
+ |/src/commonMain/kotlin/testing/Test.kt
+ |package testing
+ |
+ |expect open class Test
+ |
+ |/src/jvmMain/kotlin/testing/Test.kt
+ |package testing
+ |
+ |actual open class Test
+ """.trimIndent()
+
+ val writerPlugin = TestOutputWriterPlugin()
+ testInline(
+ source,
+ configuration,
+ pluginOverrides = listOf(writerPlugin)
+ ) {
+ renderingStage = { _, _ ->
+ val packagePage = writerPlugin.writer.renderedContent("-dokka -module/testing/index.html")
+
+ val testClassRow = packagePage
+ .select("div[data-togglable=TYPE]")
+ .select("div[class=table-row]")
+ .single()
+
+ assertEquals("Dokka Module/common,Dokka Module/jvm", testClassRow.attr("data-filterable-current"))
+ assertEquals("Dokka Module/common,Dokka Module/jvm", testClassRow.attr("data-filterable-set"))
+ }
+ }
+ }
+}