mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-01-03 04:28:07 -05:00
refactor: Add defaults for AboutScreenContent
This commit is contained in:
@@ -16,12 +16,7 @@ class ComposeAboutActivityTest {
|
||||
@Test
|
||||
fun testPasses(): Unit = with(rule) {
|
||||
setContent {
|
||||
AboutScreenContent(
|
||||
content = AboutContent(LocalContext.current),
|
||||
showDonate = true,
|
||||
showRateOnGooglePlay = false,
|
||||
onBackPressedDispatcher = null
|
||||
)
|
||||
AboutScreenContent(AboutContent(LocalContext.current))
|
||||
}
|
||||
|
||||
onNodeWithTag("topbar_catima").assertIsDisplayed()
|
||||
@@ -30,12 +25,7 @@ class ComposeAboutActivityTest {
|
||||
@Test
|
||||
fun testFails(): Unit = with(rule) {
|
||||
setContent {
|
||||
AboutScreenContent(
|
||||
content = AboutContent(LocalContext.current),
|
||||
showDonate = true,
|
||||
showRateOnGooglePlay = false,
|
||||
onBackPressedDispatcher = null
|
||||
)
|
||||
AboutScreenContent(AboutContent(LocalContext.current))
|
||||
}
|
||||
|
||||
onNodeWithTag("topbar_catima").assertIsNotDisplayed()
|
||||
|
||||
@@ -54,9 +54,9 @@ class AboutActivity : ComponentActivity() {
|
||||
@Composable
|
||||
fun AboutScreenContent(
|
||||
content: AboutContent,
|
||||
showDonate: Boolean,
|
||||
showRateOnGooglePlay: Boolean,
|
||||
onBackPressedDispatcher: OnBackPressedDispatcher?,
|
||||
showDonate: Boolean = true,
|
||||
showRateOnGooglePlay: Boolean = true,
|
||||
onBackPressedDispatcher: OnBackPressedDispatcher? = null,
|
||||
) {
|
||||
CatimaTheme {
|
||||
Scaffold(
|
||||
@@ -166,10 +166,5 @@ fun AboutScreenContent(
|
||||
@Preview
|
||||
@Composable
|
||||
fun AboutActivityPreview() {
|
||||
AboutScreenContent(
|
||||
content = AboutContent(LocalContext.current),
|
||||
showDonate = true,
|
||||
showRateOnGooglePlay = true,
|
||||
onBackPressedDispatcher = null
|
||||
)
|
||||
AboutScreenContent(AboutContent(LocalContext.current))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user