Commit 39f861c 1 parent 0b8be29 commit 39f861c Copy full SHA for 39f861c
File tree 1 file changed +20
-0
lines changed
core/ui/src/androidTest/java/io/jja08111/gemini/core/ui
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,26 @@ class CrossFadeTest {
36
36
composeRule.onNodeWithText(SECOND_TITLE ).assertIsDisplayed()
37
37
}
38
38
39
+ @Test
40
+ fun shouldSwitchToFirstComponent () {
41
+ var showFirst by mutableStateOf(false )
42
+ composeRule.setContent {
43
+ CrossFade (
44
+ showFirst = showFirst,
45
+ firstContent = { FirstComponent () },
46
+ secondContent = { SecondComponent () },
47
+ )
48
+ }
49
+
50
+ composeRule.onNodeWithText(FIRST_TITLE ).assertIsNotDisplayed()
51
+ composeRule.onNodeWithText(SECOND_TITLE ).assertIsDisplayed()
52
+
53
+ showFirst = true
54
+
55
+ composeRule.onNodeWithText(FIRST_TITLE ).assertIsDisplayed()
56
+ composeRule.onNodeWithText(SECOND_TITLE ).assertIsNotDisplayed()
57
+ }
58
+
39
59
@Suppress(" TestFunctionName" )
40
60
@Composable
41
61
private fun FirstComponent () {
You can’t perform that action at this time.
0 commit comments