Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
malmstein committed Sep 4, 2023
1 parent 08a3d6c commit b38d8e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class BookmarksViewModel @Inject constructor(
favourites[index] = savedSite.copy(deleted = "1")

viewState.value = viewState.value?.copy(
favorites = favourites
favorites = favourites,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import com.duckduckgo.savedsites.api.SavedSitesRepository
import com.duckduckgo.savedsites.api.models.BookmarkFolder
import com.duckduckgo.savedsites.api.models.BookmarkFolderItem
import com.duckduckgo.savedsites.api.models.FolderBranch
import com.duckduckgo.savedsites.api.models.SavedSite
import com.duckduckgo.savedsites.api.models.SavedSite.Bookmark
import com.duckduckgo.savedsites.api.models.SavedSite.Favorite
import com.duckduckgo.savedsites.api.models.SavedSites
Expand Down Expand Up @@ -75,8 +74,8 @@ class BookmarksViewModelTest {
private val pixel: Pixel = mock()

private val bookmark =
SavedSite.Bookmark(id = "bookmark1", title = "title", url = "www.example.com", parentId = SavedSitesNames.BOOKMARKS_ROOT, "timestamp")
private val favorite = SavedSite.Favorite(id = "favorite1", title = "title", url = "www.example.com", position = 0, lastModified = "timestamp")
Bookmark(id = "bookmark1", title = "title", url = "www.example.com", parentId = SavedSitesNames.BOOKMARKS_ROOT, "timestamp")
private val favorite = Favorite(id = "bookmark1", title = "title", url = "www.example.com", position = 0, lastModified = "timestamp")
private val bookmarkFolder = BookmarkFolder(id = "folder1", name = "folder", parentId = SavedSitesNames.BOOKMARKS_ROOT, 0, 0, "timestamp")
private val bookmarkFolderItem = BookmarkFolderItem(0, bookmarkFolder, true)

Expand All @@ -96,7 +95,7 @@ class BookmarksViewModelTest {

@Before
fun before() = runTest {
whenever(savedSitesRepository.getFavorites()).thenReturn(flowOf())
whenever(savedSitesRepository.getFavorites()).thenReturn(flowOf(listOf(favorite)))

whenever(savedSitesRepository.getFolderContent(anyString())).thenReturn(
flowOf(
Expand Down

0 comments on commit b38d8e8

Please sign in to comment.