aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test
diff options
context:
space:
mode:
authorVadim Mishenev <vad-mishenev@yandex.ru>2023-03-03 12:13:49 +0200
committerGitHub <noreply@github.com>2023-03-03 12:13:49 +0200
commitdca5c3184b22b6efe0626b278f01711118fcaf0d (patch)
tree9c014a12f61f0d955256d81c5e045c53c19506bd /plugins/base/src/test
parent086b7893f497e0153a6b4213cc5ad40f5bbb3ba2 (diff)
downloaddokka-dca5c3184b22b6efe0626b278f01711118fcaf0d.tar.gz
dokka-dca5c3184b22b6efe0626b278f01711118fcaf0d.tar.bz2
dokka-dca5c3184b22b6efe0626b278f01711118fcaf0d.zip
Do no render Types tab when there are no types (#2900)
Diffstat (limited to 'plugins/base/src/test')
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/TabbedContentTest.kt34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/base/src/test/kotlin/renderers/html/TabbedContentTest.kt b/plugins/base/src/test/kotlin/renderers/html/TabbedContentTest.kt
index 306925b3..fbadb021 100644
--- a/plugins/base/src/test/kotlin/renderers/html/TabbedContentTest.kt
+++ b/plugins/base/src/test/kotlin/renderers/html/TabbedContentTest.kt
@@ -71,6 +71,40 @@ class TabbedContentTest : BaseAbstractTest() {
}
}
+ @Test
+ fun `should not have Types-tab where there are not types`() {
+ val source = """
+ |/src/main/kotlin/test/Test.kt
+ |package example
+ |
+ |val p = 0
+ |fun foo() = 0
+ |
+ |/src/main/kotlin/test/PackageTwo.kt
+ |package example2
+ |
+ |class A
+ """
+ val writerPlugin = TestOutputWriterPlugin()
+
+ testInline(
+ source,
+ configuration,
+ pluginOverrides = listOf(writerPlugin)
+ ) {
+ renderingStage = { _, _ ->
+ val packagePage = writerPlugin.writer.renderedContent("root/example/index.html")
+ assertEquals(0, packagePage.select("*[data-togglable=TYPE]").size)
+ assertEquals(1, packagePage.getTabbedTable("PROPERTY").size)
+ assertEquals(1, packagePage.getTabbedTable("FUNCTION").size)
+
+ val packagePage2 = writerPlugin.writer.renderedContent("root/example2/index.html")
+ assertEquals(2, packagePage2.select("*[data-togglable=TYPE]").size)
+ assertEquals(0, packagePage2.getTabbedTable("PROPERTY").size)
+ assertEquals(0, packagePage2.getTabbedTable("FUNCTION").size)
+ }
+ }
+ }
@Test
fun `should have correct order of members and extensions`() {