diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-04-07 00:20:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-07 00:20:47 +0200 |
commit | 21afcb40ad5265d2214c05179614eb2f070526f2 (patch) | |
tree | f1fec88d9b8a87fa0a37e7f2030a1641f27f5653 /plugins/base/src/test/kotlin/renderers/html | |
parent | f5789ed721c1609899d9197a34d73b223289fc96 (diff) | |
download | dokka-21afcb40ad5265d2214c05179614eb2f070526f2.tar.gz dokka-21afcb40ad5265d2214c05179614eb2f070526f2.tar.bz2 dokka-21afcb40ad5265d2214c05179614eb2f070526f2.zip |
Move the `Properties` block to be above `Functions` (#2908)
Diffstat (limited to 'plugins/base/src/test/kotlin/renderers/html')
-rw-r--r-- | plugins/base/src/test/kotlin/renderers/html/TabbedContentTest.kt | 36 |
1 files changed, 36 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 fbadb021..7c42c22b 100644 --- a/plugins/base/src/test/kotlin/renderers/html/TabbedContentTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/TabbedContentTest.kt @@ -142,4 +142,40 @@ class TabbedContentTest : BaseAbstractTest() { } } } + + @Test + fun `should have expected order of content types within a members tab`() { + val source = """ + |/src/main/kotlin/test/Result.kt + |package example + | + |class Result(val d: Int = 0) { + | class Success(): Result() + | + | val isFailed = false + | fun reset() = 0 + | fun String.extension() = 0 + |} + """ + val writerPlugin = TestOutputWriterPlugin() + + testInline( + source, + configuration, + pluginOverrides = listOf(writerPlugin) + ) { + renderingStage = { _, _ -> + val classContent = writerPlugin.writer.renderedContent("root/example/-result/index.html") + val tabSectionNames = classContent.select("div .tabs-section-body > div[data-togglable]") + .map { it.attr("data-togglable") } + + val expectedOrder = listOf("CONSTRUCTOR", "TYPE", "PROPERTY", "FUNCTION") + + assertEquals(expectedOrder.size, tabSectionNames.size) + expectedOrder.forEachIndexed { index, element -> + assertEquals(element, tabSectionNames[index]) + } + } + } + } }
\ No newline at end of file |