-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing tab entries for module names with space (#3019)
(cherry picked from commit 63bed7c)
- Loading branch information
1 parent
e3c383c
commit fb0dc31
Showing
5 changed files
with
89 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
plugins/base/src/test/kotlin/renderers/html/SourceSetFilterTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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")) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters