aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt
diff options
context:
space:
mode:
authorVadim Mishenev <vad-mishenev@yandex.ru>2023-02-24 17:44:24 +0200
committerGitHub <noreply@github.com>2023-02-24 17:44:24 +0200
commit1040288ca76e070445f1400df2fcc5a56310be28 (patch)
tree52bed40e8a320f0835540b0cd38ea1899800e395 /plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt
parent8d23340d1c377b8f490cdee3c2c874453d321dd8 (diff)
downloaddokka-1040288ca76e070445f1400df2fcc5a56310be28.tar.gz
dokka-1040288ca76e070445f1400df2fcc5a56310be28.tar.bz2
dokka-1040288ca76e070445f1400df2fcc5a56310be28.zip
Reorganize tabs for Classlike (#2764)
Diffstat (limited to 'plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt')
-rw-r--r--plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt17
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt b/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt
index 0ed5af9f..686b4990 100644
--- a/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt
+++ b/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt
@@ -4,6 +4,7 @@ import org.jetbrains.dokka.CoreExtensions
import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.plugability.DokkaPlugin
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
+import org.jetbrains.dokka.model.dfs
import org.jetbrains.dokka.transformers.pages.PageTransformer
import org.jetbrains.dokka.transformers.pages.pageMapper
import org.jetbrains.dokka.transformers.pages.pageScanner
@@ -12,8 +13,7 @@ import org.jsoup.Jsoup
import org.junit.jupiter.api.Test
import utils.TestOutputWriterPlugin
import utils.assertContains
-import kotlin.test.assertEquals
-
+import utils.assertNotNull
class PageTransformerBuilderTest : BaseAbstractTest() {
class ProxyPlugin(transformer: PageTransformer) : DokkaPlugin() {
@@ -136,7 +136,7 @@ class PageTransformerBuilderTest : BaseAbstractTest() {
}
@Test
- fun `kotlin constructors tab should exist even though there is primary constructor only`() {
+ fun `kotlin constructors should exist even though there is primary constructor only`() {
val configuration = dokkaConfiguration {
sourceSets {
sourceSet {
@@ -160,13 +160,12 @@ class PageTransformerBuilderTest : BaseAbstractTest() {
.filterIsInstance<ContentGroup>()
.single { it.dci.kind == ContentKind.Main }.children
- val constructorTabsCount = content.filter { it is ContentHeader }.flatMap {
- it.children.filter { it is ContentText }
- }.count {
- (it as? ContentText)?.text == "Constructors"
- }
+ val contentWithConstructorsHeader = content.find { tabContent -> tabContent.dfs { it is ContentText && (it as? ContentText)?.text == "Constructors"} != null }
+
+ contentWithConstructorsHeader.assertNotNull("contentWithConstructorsHeader")
- assertEquals(1, constructorTabsCount)
+ contentWithConstructorsHeader?.dfs { it.dci.kind == ContentKind.Constructors && it is ContentGroup }
+ .assertNotNull("constructor group")
}
}
}