diff --git a/Corona-Warn-App/src/androidTest/java/de/rki/coronawarnapp/ui/contactdiary/ContactDiaryOverviewFragmentTest.kt b/Corona-Warn-App/src/androidTest/java/de/rki/coronawarnapp/ui/contactdiary/ContactDiaryOverviewFragmentTest.kt index 210b1574af3219dbb8e6ee0738bfb50a5d3e1c0d..6308bfb834c5f1d1d7839e4b289904cee67eae57 100644 --- a/Corona-Warn-App/src/androidTest/java/de/rki/coronawarnapp/ui/contactdiary/ContactDiaryOverviewFragmentTest.kt +++ b/Corona-Warn-App/src/androidTest/java/de/rki/coronawarnapp/ui/contactdiary/ContactDiaryOverviewFragmentTest.kt @@ -99,6 +99,10 @@ class ContactDiaryOverviewFragmentTest : BaseUITest() { onView(withId(R.id.contact_diary_overview_recyclerview)) .perform(recyclerScrollTo(4)) takeScreenshot<ContactDiaryOverviewFragment>("2") + + onView(withId(R.id.contact_diary_overview_recyclerview)) + .perform(recyclerScrollTo(10)) + takeScreenshot<ContactDiaryOverviewFragment>("3") } private fun contactDiaryOverviewItemLiveData(): LiveData<List<DiaryOverviewItem>> { @@ -139,11 +143,20 @@ class ContactDiaryOverviewFragmentTest : BaseUITest() { else -> null } + val coronaTestEvent = when (index) { + 8 -> { + DiaryData.TEST_ITEM + } + + else -> null + } + DayOverviewItem( date = localDate, contactItem = ContactItem(dayData), riskEnfItem = riskEnf, - riskEventItem = riskEvent + riskEventItem = riskEvent, + coronaTestItem = coronaTestEvent ) { // onClick } diff --git a/Corona-Warn-App/src/androidTest/java/de/rki/coronawarnapp/ui/contactdiary/DiaryData.kt b/Corona-Warn-App/src/androidTest/java/de/rki/coronawarnapp/ui/contactdiary/DiaryData.kt index eddad5048b6c161ac5d076c2d3ace5972b35a58e..dcd752dbaf109d2a93d9c4bb8cd833669c990c7d 100644 --- a/Corona-Warn-App/src/androidTest/java/de/rki/coronawarnapp/ui/contactdiary/DiaryData.kt +++ b/Corona-Warn-App/src/androidTest/java/de/rki/coronawarnapp/ui/contactdiary/DiaryData.kt @@ -11,6 +11,7 @@ import de.rki.coronawarnapp.contactdiary.model.DefaultContactDiaryPersonEncounte import de.rki.coronawarnapp.contactdiary.ui.day.tabs.location.DiaryLocationListItem import de.rki.coronawarnapp.contactdiary.ui.day.tabs.person.DiaryPersonListItem import de.rki.coronawarnapp.contactdiary.ui.overview.adapter.day.contact.ContactItem +import de.rki.coronawarnapp.contactdiary.ui.overview.adapter.day.coronatest.CoronaTestItem import de.rki.coronawarnapp.contactdiary.ui.overview.adapter.day.riskenf.RiskEnfItem import de.rki.coronawarnapp.contactdiary.ui.overview.adapter.day.riskevent.RiskEventItem import org.joda.time.Duration @@ -111,6 +112,20 @@ object DiaryData { events = listOf(LOW_RISK_EVENT) ) + val PCR_TEST_NEGATIVE = CoronaTestItem.Data( + icon = R.drawable.ic_corona_test_icon_green, + header = R.string.contact_diary_corona_test_pcr_title, + body = R.string.contact_diary_corona_test_negative + ) + + val RAT_TEST_POSITIVE = CoronaTestItem.Data( + icon = R.drawable.ic_corona_test_icon_red, + header = R.string.contact_diary_corona_test_rat_title, + body = R.string.contact_diary_corona_test_positive + ) + + val TEST_ITEM = CoronaTestItem(listOf(PCR_TEST_NEGATIVE, RAT_TEST_POSITIVE)) + val LOCATIONS: List<DiaryLocationListItem> = listOf( DiaryLocationListItem( item = DefaultContactDiaryLocation(locationName = "Physiotherapie"), diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/contactdiary/ui/overview/adapter/day/DayOverviewVH.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/contactdiary/ui/overview/adapter/day/DayOverviewVH.kt index 8807a0a6b570d6d4c3fba02b35832c52ed2c86b3..f4b5ecd43ecc81a31e50b8ca8932ce2de07faa66 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/contactdiary/ui/overview/adapter/day/DayOverviewVH.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/contactdiary/ui/overview/adapter/day/DayOverviewVH.kt @@ -93,7 +93,7 @@ class DayOverviewVH(parent: ViewGroup) : } private fun ContactDiaryOverviewDayListItemContactBinding.apply(contactItem: ContactItem?) { - root.isGone = contactItem == null + root.isGone = contactItem == null || contactItem.data.isEmpty() contactItem?.let { recyclerView.apply {