Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Recent bookmarks controller tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Elise Richards committed Aug 23, 2021
1 parent 7f179f1 commit 6ca26a0
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package org.mozilla.fenix.home.recentbookmarks
import androidx.navigation.NavController
import io.mockk.Runs
import io.mockk.every
import io.mockk.impl.annotations.RelaxedMockK
import io.mockk.just
import io.mockk.mockk
import io.mockk.spyk
Expand Down Expand Up @@ -94,8 +95,8 @@ class DefaultRecentBookmarksControllerTest {
newTab = true,
from = BrowserDirection.FromHome
)
activity.components.core.metrics.track(Event.BookmarkClicked)
}
verify { metrics.track(Event.BookmarkClicked) }
verify(exactly = 0) {
navController.navigateUp()
}
Expand All @@ -111,8 +112,8 @@ class DefaultRecentBookmarksControllerTest {

val directions = HomeFragmentDirections.actionGlobalBookmarkFragment(BookmarkRoot.Mobile.id)
verify {
activity.components.core.metrics.track(Event.ShowAllBookmarks)
navController.navigate(directions)
metrics.track(Event.ShowAllBookmarks)
}
verify(exactly = 0) {
navController.navigateUp()
Expand All @@ -128,11 +129,12 @@ class DefaultRecentBookmarksControllerTest {
controller.handleShowAllBookmarksClicked()

val directions = HomeFragmentDirections.actionGlobalBookmarkFragment(BookmarkRoot.Mobile.id)

verify {
activity.components.core.metrics.track(Event.ShowAllBookmarks)
controller.dismissSearchDialogIfDisplayed()
navController.navigateUp()
navController.navigate(directions)
metrics.track(Event.ShowAllBookmarks)
}
}
}

0 comments on commit 6ca26a0

Please sign in to comment.