1
0
Fork 0

Fixes #4997: Changed navigation to ShareFragment

Changed test for new global navigation to share fragment.
master
mihai-adrian 2019-08-30 11:24:28 +03:00 committed by Emily Kager
parent fc8fc2b33d
commit 3171f3a1a7
1 changed files with 3 additions and 4 deletions

View File

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