Skip to content

Commit

Permalink
For mozilla-mobile#8474 Remove obsolete unit tests for removed menu i…
Browse files Browse the repository at this point in the history
…tems
  • Loading branch information
mcarare committed Mar 11, 2020
1 parent 487b147 commit 42a932d
Showing 1 changed file with 0 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 42a932d

Please sign in to comment.