-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix css bugs wih link and table row (#2284)
* Remove extra top margin in paragraph * Remove margin-bottom from platform-hinted * Fix link underlining in table and anchor icon * Make breakable names of constructors * Add test for breakable name of constructor (cherry picked from commit 9a61f49)
- Loading branch information
1 parent
f7db503
commit 01a17fc
Showing
4 changed files
with
55 additions
and
5 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
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
48 changes: 48 additions & 0 deletions
48
plugins/base/src/test/kotlin/content/functions/ContentForConstructors.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,48 @@ | ||
package content.functions | ||
|
||
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest | ||
import org.jetbrains.dokka.model.DClass | ||
import org.jetbrains.dokka.model.dfs | ||
import org.jetbrains.dokka.pages.* | ||
import org.junit.jupiter.api.Test | ||
import utils.assertNotNull | ||
import kotlin.test.assertEquals | ||
|
||
class ContentForConstructors : BaseAbstractTest() { | ||
private val testConfiguration = dokkaConfiguration { | ||
sourceSets { | ||
sourceSet { | ||
sourceRoots = listOf("src/") | ||
analysisPlatform = "jvm" | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
fun `constructor name should have RowTitle style`() { | ||
testInline(""" | ||
|/src/main/kotlin/test/source.kt | ||
|package test | ||
| | ||
|/** | ||
| * Dummy text. | ||
| */ | ||
|class Example(val exampleParameter: Int) { | ||
|} | ||
""".trimIndent(), testConfiguration) { | ||
pagesTransformationStage = { module -> | ||
val classPage = | ||
module.dfs { it.name == "Example" && (it as ContentPage).documentable is DClass } as ContentPage | ||
val constructorsTable = | ||
classPage.content.dfs { it is ContentTable && it.dci.kind == ContentKind.Constructors } as ContentTable | ||
|
||
assertEquals(1, constructorsTable.children.size) | ||
val primary = constructorsTable.children.first() | ||
val constructorName = | ||
primary.dfs { (it as? ContentText)?.text == "Example" }.assertNotNull("constructorName") | ||
|
||
assert(ContentStyle.RowTitle in constructorName.style) | ||
} | ||
} | ||
} | ||
} |