From 5365398845791e65ea3515c649278eff7002d54b Mon Sep 17 00:00:00 2001 From: Elise Richards Date: Mon, 23 Aug 2021 09:52:46 -0700 Subject: [PATCH] Recent bookmarks controller tests --- .../DefaultRecentBookmarksControllerTest.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/test/java/org/mozilla/fenix/home/recentbookmarks/DefaultRecentBookmarksControllerTest.kt b/app/src/test/java/org/mozilla/fenix/home/recentbookmarks/DefaultRecentBookmarksControllerTest.kt index 5d89ec1f51e8..8a0a64eded73 100644 --- a/app/src/test/java/org/mozilla/fenix/home/recentbookmarks/DefaultRecentBookmarksControllerTest.kt +++ b/app/src/test/java/org/mozilla/fenix/home/recentbookmarks/DefaultRecentBookmarksControllerTest.kt @@ -94,8 +94,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() } @@ -111,8 +111,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() @@ -128,11 +128,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) } } }