File tree Expand file tree Collapse file tree 4 files changed +43
-2
lines changed
commonTest/kotlin/components Expand file tree Collapse file tree 4 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -13,13 +13,18 @@ kotlin {
1313 commonWebpackConfig {
1414 outputFileName = " composeApp.js"
1515 }
16+ testTask {
17+ useKarma {
18+ useFirefox()
19+ }
20+ }
1621 }
1722 binaries.executable()
1823 }
1924
2025 androidTarget {}
2126
22- jvm(" desktop " )
27+ jvm()
2328
2429 listOf (
2530 iosX64(),
@@ -55,12 +60,25 @@ kotlin {
5560 implementation(libs.compose.webview)
5661 }
5762 }
58- val desktopMain by getting {
63+ val jvmMain by getting {
5964 dependencies {
6065 implementation(compose.desktop.common)
6166 implementation(compose.desktop.currentOs)
6267 }
6368 }
69+
70+ val commonTest by getting {
71+ dependencies {
72+ implementation(kotlin(" test" ))
73+
74+ @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary ::class )
75+ implementation(compose.uiTest)
76+ }
77+ }
78+
79+ jvmTest.dependencies {
80+ implementation(compose.desktop.currentOs)
81+ }
6482 }
6583}
6684
Original file line number Diff line number Diff line change 1+ package components
2+
3+ import androidx.compose.ui.test.ExperimentalTestApi
4+ import androidx.compose.ui.test.onNodeWithContentDescription
5+ import androidx.compose.ui.test.onNodeWithText
6+ import androidx.compose.ui.test.performClick
7+ import androidx.compose.ui.test.runComposeUiTest
8+ import kotlin.test.Test
9+
10+ class FilterChipTest {
11+
12+ @OptIn(ExperimentalTestApi ::class )
13+ @Test
14+ fun `filter chip should be clickable and icon should be visible when clicked` () = runComposeUiTest {
15+ setContent {
16+ FilterChipExample ()
17+ }
18+
19+ onNodeWithText(" Filter chip" ).assertExists()
20+ onNodeWithText(" Filter chip" ).performClick()
21+ onNodeWithContentDescription(" Done icon" ).assertExists()
22+ }
23+ }
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments