app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

commit e1b258e9359809da3e488f3546e4d13a0bb5d0a3
parent ae0179669c59261fe273a58d781763f69ad2b198
Author: triesap <tyson@radroots.org>
Date:   Sat,  1 Aug 2026 18:17:55 +0000

test: establish the Compose test runtime

- add cataloged Compose UI test dependencies
- configure JVM tests to reject zero discovered cases
- prove Compose content through the multiplatform UI test API
- keep the Kotlin and Compose versions centrally governed

Diffstat:
Mapp/desktop/build.gradle.kts | 8++++++++
Aapp/desktop/src/test/kotlin/org/radroots/studio/application/RadrootsApplicationTest.kt | 20++++++++++++++++++++
Mgradle/libs.versions.toml | 1+
3 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/app/desktop/build.gradle.kts b/app/desktop/build.gradle.kts @@ -1,4 +1,5 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat +import org.gradle.api.tasks.testing.Test import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { @@ -10,6 +11,13 @@ plugins { dependencies { implementation(compose.desktop.currentOs) implementation(libs.compose.foundation) + + testImplementation(kotlin("test-junit")) + testImplementation(libs.compose.ui.test.junit4) +} + +tasks.withType<Test>().configureEach { + failOnNoDiscoveredTests.set(true) } kotlin { diff --git a/app/desktop/src/test/kotlin/org/radroots/studio/application/RadrootsApplicationTest.kt b/app/desktop/src/test/kotlin/org/radroots/studio/application/RadrootsApplicationTest.kt @@ -0,0 +1,20 @@ +package org.radroots.studio.application + +import androidx.compose.foundation.text.BasicText +import androidx.compose.ui.test.ExperimentalTestApi +import androidx.compose.ui.test.assertIsDisplayed +import androidx.compose.ui.test.onNodeWithText +import androidx.compose.ui.test.v2.runComposeUiTest +import kotlin.test.Test + +class RadrootsApplicationTest { + @OptIn(ExperimentalTestApi::class) + @Test + fun composeUiTestRuntimeRendersContent() = runComposeUiTest { + setContent { + BasicText("radroots") + } + + onNodeWithText("radroots").assertIsDisplayed() + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml @@ -4,6 +4,7 @@ compose = "1.11.1" [libraries] compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "compose" } +compose-ui-test-junit4 = { module = "org.jetbrains.compose.ui:ui-test-junit4", version.ref = "compose" } [plugins] kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }