|
|
@ -174,12 +174,11 @@ class BookmarksScreenTest {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
fun feed_whenLifecycleStops_undoBookmarkedStateIsCleared() = runTest {
|
|
|
|
fun feed_whenLifecycleStops_undoBookmarkedStateIsCleared() = runTest {
|
|
|
|
|
|
|
|
|
|
|
|
var undoStateCleared = false
|
|
|
|
var undoStateCleared = false
|
|
|
|
val testLifecycleOwner = TestLifecycleOwner(initialState = Lifecycle.State.STARTED)
|
|
|
|
val testLifecycleOwner = TestLifecycleOwner(initialState = Lifecycle.State.STARTED)
|
|
|
|
|
|
|
|
|
|
|
|
composeTestRule.setContent {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
CompositionLocalProvider(LocalLifecycleOwner provides testLifecycleOwner){
|
|
|
|
CompositionLocalProvider(LocalLifecycleOwner provides testLifecycleOwner) {
|
|
|
|
BookmarksScreen(
|
|
|
|
BookmarksScreen(
|
|
|
|
feedState = NewsFeedUiState.Success(emptyList()),
|
|
|
|
feedState = NewsFeedUiState.Success(emptyList()),
|
|
|
|
onShowSnackbar = { _, _ -> false },
|
|
|
|
onShowSnackbar = { _, _ -> false },
|
|
|
@ -188,7 +187,7 @@ class BookmarksScreenTest {
|
|
|
|
onNewsResourceViewed = {},
|
|
|
|
onNewsResourceViewed = {},
|
|
|
|
clearUndoState = {
|
|
|
|
clearUndoState = {
|
|
|
|
undoStateCleared = true
|
|
|
|
undoStateCleared = true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|