Added first draft of tests

pull/507/head
magicalmeghan 2 years ago
parent a8f55d9d38
commit 9a900f9900

@ -144,6 +144,20 @@ class GetUserNewsResourcesUseCaseTest {
saveableNewsResources.first()
)
}
//verify that news resources contain the correct FollowedTopics
@Test
fun newsResourcesContainCorrectFollowedTopics() = runTest {
assertEquals(
sampleNewsResources[0].topics, listOf(sampleTopic1)
)
assertEquals(
sampleNewsResources[1].topics, listOf(sampleTopic1, sampleTopic2)
)
assertEquals(
sampleNewsResources[2].topics, listOf(sampleTopic2)
)
}
}
private val sampleTopic1 = Topic(

@ -75,4 +75,20 @@ class NewsResourceCardTest {
.onNodeWithText(dateFormatted)
.assertIsDisplayed()
}
// Test that chip color is different if topic is followed
@Test
fun testChipColor() {
val newsWithUnknownResourceType = previewUserNewsResources[1]
composeTestRule.setContent {
NewsResourceTopics(topics = newsWithUnknownResourceType.topics)
}
composeTestRule
.onNodeWithText("UI")
//figure out how to get the color of the chip and compare it to
// MaterialTheme.colorScheme.primaryContainer
}
}

Loading…
Cancel
Save