2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] Fixes https://github.com/mozilla-mobile/fenix/issues/4997: Changed navigation to ShareFragment

Changed test for new global navigation to share fragment.
This commit is contained in:
mihai-adrian 2019-08-30 11:24:28 +03:00 committed by Emily Kager
parent 0f119aae4e
commit 309495f15a

View File

@ -23,6 +23,7 @@ import mozilla.components.feature.tabs.TabsUseCases
import org.junit.Before import org.junit.Before
import org.junit.Test import org.junit.Test
import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.NavGraphDirections
import org.mozilla.fenix.R import org.mozilla.fenix.R
import org.mozilla.fenix.browser.BrowserFragment import org.mozilla.fenix.browser.BrowserFragment
import org.mozilla.fenix.browser.BrowserFragmentDirections import org.mozilla.fenix.browser.BrowserFragmentDirections
@ -225,14 +226,12 @@ class DefaultBrowserToolbarControllerTest {
val item = ToolbarMenu.Item.Share val item = ToolbarMenu.Item.Share
every { currentSession.url } returns "https://mozilla.org" every { currentSession.url } returns "https://mozilla.org"
val directions = NavGraphDirections.actionGlobalShareFragment(currentSession.url)
controller.handleToolbarItemInteraction(item) controller.handleToolbarItemInteraction(item)
verify { metrics.track(Event.BrowserMenuItemTapped(Event.BrowserMenuItemTapped.Item.SHARE)) } verify { metrics.track(Event.BrowserMenuItemTapped(Event.BrowserMenuItemTapped.Item.SHARE)) }
verify { verify { navController.navigate(directions) }
val directions = BrowserFragmentDirections.actionBrowserFragmentToShareFragment(currentSession.url)
navController.nav(R.id.browserFragment, directions)
}
} }
@Test @Test