Restore `Unknown` type as empty `String`

pull/902/head
Simon Marquis 1 year ago
parent c831dc673c
commit f1bc6f1226

@ -65,7 +65,7 @@ val newsResourcesTestData: List<NewsResource> = listOf(
url = "https://developer.android.com/jetpack/androidx/versions/all-channel",
headerImageUrl = "",
publishDate = Instant.parse("2022-10-01T00:00:00.000Z"),
type = "Unknown",
type = "",
topics = listOf(topicsTestData[2]),
),
)

@ -99,7 +99,7 @@ val userNewsResourcesTestData: List<UserNewsResource> = UserData(
url = "https://developer.android.com/jetpack/androidx/versions/all-channel",
headerImageUrl = "",
publishDate = Instant.parse("2022-10-01T00:00:00.000Z"),
type = "Unknown",
type = "",
topics = listOf(topicsTestData[2]),
),
userData = userData,

@ -61,13 +61,13 @@ class NewsResourceCardTest {
}
@Test
fun testMetaDataDisplay_withUnknownResource() {
val newsWithUnknownResourceType = userNewsResourcesTestData[3]
fun testMetaDataDisplay_withEmptyResourceType() {
val newsWithEmptyResourceType = userNewsResourcesTestData[3]
var dateFormatted = ""
composeTestRule.setContent {
NewsResourceCardExpanded(
userNewsResource = newsWithUnknownResourceType,
userNewsResource = newsWithEmptyResourceType,
isBookmarked = false,
hasBeenViewed = false,
onToggleBookmark = {},
@ -75,11 +75,11 @@ class NewsResourceCardTest {
onTopicClick = {},
)
dateFormatted = dateFormatted(publishDate = newsWithUnknownResourceType.publishDate)
dateFormatted = dateFormatted(publishDate = newsWithEmptyResourceType.publishDate)
}
composeTestRule
.onNodeWithText(dateFormatted, substring = true)
.onNodeWithText(dateFormatted)
.assertIsDisplayed()
}

Loading…
Cancel
Save