|
|
|
@ -17,7 +17,6 @@
|
|
|
|
|
package com.google.samples.apps.nowinandroid.feature.bookmarks
|
|
|
|
|
|
|
|
|
|
import androidx.activity.ComponentActivity
|
|
|
|
|
import androidx.compose.material3.windowsizeclass.WindowSizeClass
|
|
|
|
|
import androidx.compose.ui.test.assertCountEquals
|
|
|
|
|
import androidx.compose.ui.test.assertHasClickAction
|
|
|
|
|
import androidx.compose.ui.test.filter
|
|
|
|
@ -65,8 +64,6 @@ class BookmarksScreenTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
fun feed_whenHasBookmarks_showsBookmarks() {
|
|
|
|
|
lateinit var windowSizeClass: WindowSizeClass
|
|
|
|
|
|
|
|
|
|
composeTestRule.setContent {
|
|
|
|
|
BookmarksScreen(
|
|
|
|
|
feedState = NewsFeedUiState.Success(
|
|
|
|
@ -138,4 +135,26 @@ class BookmarksScreenTest {
|
|
|
|
|
|
|
|
|
|
assertTrue(removeFromBookmarksCalled)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
fun feed_whenHasNoBookmarks_showsEmptyState() {
|
|
|
|
|
composeTestRule.setContent {
|
|
|
|
|
BookmarksScreen(
|
|
|
|
|
feedState = NewsFeedUiState.Success(emptyList()),
|
|
|
|
|
removeFromBookmarks = { }
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
composeTestRule
|
|
|
|
|
.onNodeWithText(
|
|
|
|
|
composeTestRule.activity.getString(R.string.bookmarks_empty_error)
|
|
|
|
|
)
|
|
|
|
|
.assertExists()
|
|
|
|
|
|
|
|
|
|
composeTestRule
|
|
|
|
|
.onNodeWithText(
|
|
|
|
|
composeTestRule.activity.getString(R.string.bookmarks_empty_description)
|
|
|
|
|
)
|
|
|
|
|
.assertExists()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|