Skip to content

Commit 0a5824d

Browse files
committed
Creating tests for WelcomeSurvey.kt
1 parent c6090d5 commit 0a5824d

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package processing.app.ui
2+
3+
import androidx.compose.ui.test.*
4+
import processing.app.ui.theme.PDETheme
5+
import kotlin.test.Test
6+
7+
@OptIn(ExperimentalTestApi::class)
8+
class WelcomeSurveyTest {
9+
10+
@Test
11+
fun `survey card title is displayed`() = runDesktopComposeUiTest {
12+
setContent {
13+
PDETheme {
14+
SurveyInvitation()
15+
}
16+
}
17+
18+
onNodeWithText("Take the Community Survey").assertIsDisplayed()
19+
}
20+
21+
@Test
22+
fun `survey card description is displayed`() = runDesktopComposeUiTest {
23+
setContent {
24+
PDETheme {
25+
SurveyInvitation()
26+
}
27+
}
28+
29+
onNodeWithText("Processing is free, open-source, and shaped by its community. Your answers help us focus on what matters most.").assertIsDisplayed()
30+
}
31+
32+
@Test
33+
fun `survey card is clickable`() = runDesktopComposeUiTest {
34+
setContent {
35+
PDETheme {
36+
SurveyInvitation()
37+
}
38+
}
39+
40+
onNodeWithText("Take the Community Survey").performClick()
41+
}
42+
}

0 commit comments

Comments
 (0)