mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-01-18 03:48:01 -05:00
test: Add basic test for compose about screen
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package protect.card_locker
|
||||
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.test.assertIsDisplayed
|
||||
import androidx.compose.ui.test.assertIsNotDisplayed
|
||||
import androidx.compose.ui.test.junit4.ComposeContentTestRule
|
||||
import androidx.compose.ui.test.junit4.createComposeRule
|
||||
import androidx.compose.ui.test.onNodeWithTag
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class ComposeAboutActivityTest {
|
||||
@get:Rule
|
||||
val rule: ComposeContentTestRule = createComposeRule()
|
||||
|
||||
@Test
|
||||
fun testPasses(): Unit = with(rule) {
|
||||
setContent {
|
||||
AboutScreenContent(
|
||||
content = AboutContent(LocalContext.current),
|
||||
showDonate = true,
|
||||
showRateOnGooglePlay = false,
|
||||
onBackPressedDispatcher = null
|
||||
)
|
||||
}
|
||||
|
||||
onNodeWithTag("topbar_catima").assertIsDisplayed()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testFails(): Unit = with(rule) {
|
||||
setContent {
|
||||
AboutScreenContent(
|
||||
content = AboutContent(LocalContext.current),
|
||||
showDonate = true,
|
||||
showRateOnGooglePlay = false,
|
||||
onBackPressedDispatcher = null
|
||||
)
|
||||
}
|
||||
|
||||
onNodeWithTag("topbar_catima").assertIsNotDisplayed()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user