mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-17 15:26:23 +00:00
[fenix] Issue https://github.com/mozilla-mobile/fenix/issues/20864: Speculative fix for HomeFragmentTest failures
This commit is contained in:
parent
5e0b094e4f
commit
aded72af41
@ -14,6 +14,9 @@ import mozilla.components.browser.menu.view.MenuButton
|
|||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
import org.mozilla.fenix.FenixApplication
|
||||||
|
import org.mozilla.fenix.ext.application
|
||||||
|
import org.mozilla.fenix.ext.components
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
import org.mozilla.fenix.utils.Settings
|
import org.mozilla.fenix.utils.Settings
|
||||||
|
|
||||||
@ -26,13 +29,16 @@ class HomeFragmentTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun setup() {
|
fun setup() {
|
||||||
context = mockk(relaxed = true)
|
|
||||||
settings = mockk(relaxed = true)
|
settings = mockk(relaxed = true)
|
||||||
|
context = mockk(relaxed = true)
|
||||||
|
|
||||||
|
val fenixApplication: FenixApplication = mockk(relaxed = true)
|
||||||
|
|
||||||
homeFragment = spyk(HomeFragment())
|
homeFragment = spyk(HomeFragment())
|
||||||
|
|
||||||
|
every { context.application } returns fenixApplication
|
||||||
every { homeFragment.context } answers { context }
|
every { homeFragment.context } answers { context }
|
||||||
every { context.settings() } answers { settings }
|
every { context.components.settings } answers { settings }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -47,7 +53,7 @@ class HomeFragmentTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `GIVEN showTopFrecentSites is true WHEN getTopSitesConfig is called THEN it returns TopSitesConfig with non-null frecencyConfig`() {
|
fun `GIVEN showTopFrecentSites is true WHEN getTopSitesConfig is called THEN it returns TopSitesConfig with non-null frecencyConfig`() {
|
||||||
every { context.settings().showTopFrecentSites } returns true
|
every { settings.showTopFrecentSites } returns true
|
||||||
every { settings.topSitesMaxLimit } returns 10
|
every { settings.topSitesMaxLimit } returns 10
|
||||||
|
|
||||||
val topSitesConfig = homeFragment.getTopSitesConfig()
|
val topSitesConfig = homeFragment.getTopSitesConfig()
|
||||||
|
Loading…
Reference in New Issue
Block a user