Commit 95a89f9d authored by mcarare's avatar mcarare Committed by Emily Kager
Browse files

For #8474 Remove obsolete unit tests for removed menu items

parent 2ffbecae
......@@ -41,7 +41,6 @@ import org.mozilla.fenix.R
import org.mozilla.fenix.browser.BrowserAnimator
import org.mozilla.fenix.browser.BrowserFragment
import org.mozilla.fenix.browser.BrowserFragmentDirections
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
import org.mozilla.fenix.browser.browsingmode.BrowsingModeManager
import org.mozilla.fenix.collections.SaveCollectionStep
import org.mozilla.fenix.components.Analytics
......@@ -352,23 +351,6 @@ class DefaultBrowserToolbarControllerTest {
verify { navController.navigate(any<NavDirections>()) }
}
@Test
fun handleToolbarNewPrivateTabPress() {
val item = ToolbarMenu.Item.NewPrivateTab
every { browsingModeManager.mode } returns BrowsingMode.Normal
controller.handleToolbarItemInteraction(item)
verify { metrics.track(Event.BrowserMenuItemTapped(Event.BrowserMenuItemTapped.Item.NEW_PRIVATE_TAB)) }
verify {
val directions = BrowserFragmentDirections
.actionBrowserFragmentToSearchFragment(sessionId = null)
navController.nav(R.id.browserFragment, directions)
}
verify { browsingModeManager.mode = BrowsingMode.Private }
}
@Test
fun handleToolbarFindInPagePress() {
val item = ToolbarMenu.Item.FindInPage
......@@ -405,41 +387,6 @@ class DefaultBrowserToolbarControllerTest {
}
}
@Test
fun handleToolbarHelpPress() {
val tabsUseCases: TabsUseCases = mockk(relaxed = true)
val addTabUseCase: TabsUseCases.AddNewTabUseCase = mockk(relaxed = true)
val item = ToolbarMenu.Item.Help
every { activity.components.useCases.tabsUseCases } returns tabsUseCases
every { tabsUseCases.addTab } returns addTabUseCase
controller.handleToolbarItemInteraction(item)
verify { metrics.track(Event.BrowserMenuItemTapped(Event.BrowserMenuItemTapped.Item.HELP)) }
verify {
addTabUseCase.invoke(getSupportUrl())
}
}
@Test
fun handleToolbarNewTabPress() {
val item = ToolbarMenu.Item.NewTab
every { browsingModeManager.mode } returns BrowsingMode.Private
controller.handleToolbarItemInteraction(item)
verify { metrics.track(Event.BrowserMenuItemTapped(Event.BrowserMenuItemTapped.Item.NEW_TAB)) }
verify {
val directions = BrowserFragmentDirections
.actionBrowserFragmentToSearchFragment(sessionId = null)
navController.nav(R.id.browserFragment, directions)
}
verify { browsingModeManager.mode = BrowsingMode.Normal }
}
@Test
fun handleToolbarSaveToCollectionPressWhenAtLeastOneCollectionExists() {
val item = ToolbarMenu.Item.SaveToCollection
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment