|
|
@ -17,7 +17,6 @@
|
|
|
|
package com.google.samples.apps.nowinandroid.feature.bookmarks
|
|
|
|
package com.google.samples.apps.nowinandroid.feature.bookmarks
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.activity.ComponentActivity
|
|
|
|
import androidx.activity.ComponentActivity
|
|
|
|
import androidx.compose.material3.windowsizeclass.WindowSizeClass
|
|
|
|
|
|
|
|
import androidx.compose.ui.test.assertCountEquals
|
|
|
|
import androidx.compose.ui.test.assertCountEquals
|
|
|
|
import androidx.compose.ui.test.assertHasClickAction
|
|
|
|
import androidx.compose.ui.test.assertHasClickAction
|
|
|
|
import androidx.compose.ui.test.filter
|
|
|
|
import androidx.compose.ui.test.filter
|
|
|
@ -65,8 +64,6 @@ class BookmarksScreenTest {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
fun feed_whenHasBookmarks_showsBookmarks() {
|
|
|
|
fun feed_whenHasBookmarks_showsBookmarks() {
|
|
|
|
lateinit var windowSizeClass: WindowSizeClass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
composeTestRule.setContent {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
BookmarksScreen(
|
|
|
|
BookmarksScreen(
|
|
|
|
feedState = NewsFeedUiState.Success(
|
|
|
|
feedState = NewsFeedUiState.Success(
|
|
|
@ -138,4 +135,26 @@ class BookmarksScreenTest {
|
|
|
|
|
|
|
|
|
|
|
|
assertTrue(removeFromBookmarksCalled)
|
|
|
|
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()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|