Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 188a725

Browse files
authored
Enable rampdown notice. (#5913)
1 parent 2a1f046 commit 188a725

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

Corona-Warn-App/src/androidTest/java/de/rki/coronawarnapp/ui/main/home/HomeFragmentTest.kt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import testhelpers.recyclerScrollTo
4343
import testhelpers.setViewVisibility
4444
import testhelpers.takeScreenshot
4545
import timber.log.Timber
46+
import java.util.Locale
4647

4748
@RunWith(AndroidJUnit4::class)
4849
class HomeFragmentTest : BaseUITest() {
@@ -400,13 +401,22 @@ class HomeFragmentTest : BaseUITest() {
400401
private fun homeFragmentItemsLiveData(
401402
tracingStateItem: TracingStateItem = HomeData.Tracing.LOW_RISK_ITEM_WITH_ENCOUNTERS,
402403
submissionTestResultItems: List<TestResultItem> = listOf(HomeData.Submission.TEST_UNREGISTERED_ITEM),
403-
showRampDownNotice: Boolean = false
404+
showRampDownNotice: Boolean = true
404405
): LiveData<List<HomeItem>> =
405406
MutableLiveData(
406407
mutableListOf<HomeItem>().apply {
407408

408409
if (showRampDownNotice) {
409-
add(getRampDownNotice())
410+
val germanTitle = "Acthung!"
411+
val englishTitle = "Important!"
412+
val germanSubtitle =
413+
"Es wird nur noch bis zum 30. April 2023 möglich sein, andere Personen über die Corona-Warn-App zu warnen!"
414+
val englishSubtitle =
415+
"You will only be able to warn others through the Crorona-Warn-App until April 30, 2023"
416+
when (Locale.getDefault().displayLanguage) {
417+
"de" -> add(getRampDownNotice(germanTitle, germanSubtitle))
418+
else -> add(getRampDownNotice(englishTitle, englishSubtitle))
419+
}
410420
}
411421

412422
val hideTracingState = submissionTestResultItems.any {
@@ -428,12 +438,12 @@ class HomeFragmentTest : BaseUITest() {
428438
}
429439
)
430440

431-
private fun getRampDownNotice() = RampDownNoticeCard.Item(
441+
private fun getRampDownNotice(title: String, subtitle: String) = RampDownNoticeCard.Item(
432442
onClickAction = {},
433443
rampDownNotice = RampDownNotice(
434444
visible = true,
435-
title = "Betriebsende",
436-
subtitle = "Der Betrieb der Corona-Warn-App wird am xx.xx.xxxx eingestellt.",
445+
title = title,
446+
subtitle = subtitle,
437447
description = "",
438448
faqUrl = null
439449
)

0 commit comments

Comments
 (0)