aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin
diff options
context:
space:
mode:
authorVadim Mishenev <vad-mishenev@yandex.ru>2022-07-29 23:20:02 +0300
committerGitHub <noreply@github.com>2022-07-29 23:20:02 +0300
commit018af7d18f50b0677a31714e29744ac2d8713c4f (patch)
treeccd6b441fd5b92cbc8087875e457a03279a41980 /plugins/base/src/test/kotlin
parent7a875ee7d20b67725debd4c2c9e1f93e1889c302 (diff)
downloaddokka-018af7d18f50b0677a31714e29744ac2d8713c4f.tar.gz
dokka-018af7d18f50b0677a31714e29744ac2d8713c4f.tar.bz2
dokka-018af7d18f50b0677a31714e29744ac2d8713c4f.zip
Move source links into signature (#2476)
Diffstat (limited to 'plugins/base/src/test/kotlin')
-rw-r--r--plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt7
3 files changed, 5 insertions, 6 deletions
diff --git a/plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt b/plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt
index 939163ca..20805a7c 100644
--- a/plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt
+++ b/plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt
@@ -56,7 +56,7 @@ class JavaEnumsTest : BaseAbstractTest() {
) {
renderingStage = { _, _ ->
val enumPage = writerPlugin.writer.renderedContent("root/testpackage/-java-enum/index.html")
- val sourceLink = enumPage.select("div[data-togglable=Sources]")
+ val sourceLink = enumPage.select(".symbol .floating-right")
.select("a[href]")
.attr("href")
diff --git a/plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt b/plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt
index f527b87c..1fd33f6f 100644
--- a/plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt
+++ b/plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt
@@ -407,7 +407,7 @@ class KotlinEnumsTest : BaseAbstractTest() {
) {
renderingStage = { _, _ ->
val sourceLink = writerPlugin.writer.renderedContent("root/testpackage/-kotlin-enum/index.html")
- .select("div[data-togglable=Sources]")
+ .select(".symbol .floating-right")
.select("a[href]")
.attr("href")
diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
index 1a4bb330..fadc8e83 100644
--- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
+++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.cast
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
+import utils.assertNotNull
import java.net.URL
import java.nio.file.Paths
@@ -131,10 +132,8 @@ class LinkableContentTest : BaseAbstractTest() {
Assertions.assertEquals(2, packageChildren.size)
packageChildren.forEach {
val name = it.name.substringBefore("Class")
- val crl = it.safeAs<ClasslikePageNode>()?.content?.safeAs<ContentGroup>()?.children?.last()
- ?.safeAs<ContentGroup>()?.children?.last()?.safeAs<ContentGroup>()?.children?.lastOrNull()
- ?.safeAs<ContentTable>()?.children?.singleOrNull()
- ?.safeAs<ContentGroup>()?.children?.singleOrNull().safeAs<ContentResolvedLink>()
+ val signature = it.safeAs<ClasslikePageNode>()?.content?.dfs { it is ContentGroup && it.dci.kind == ContentKind.Symbol }.assertNotNull("signature")
+ val crl = signature.children.last().children[1].safeAs<ContentResolvedLink>()
Assertions.assertEquals(
"https://github.com/user/repo/tree/master/src/${name.toLowerCase()}Main/kotlin/${name}Class.kt#L3",
crl?.address