Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Close #20795: Speculative fix for intermittent test failures in HomeF…
Browse files Browse the repository at this point in the history
…ragmentTest

The expectation is that replacing `return` with `answers` will compute
the return value for the extension function again in order to avoid the
error, "no answer found for: Settings".
  • Loading branch information
jonalmeida committed Aug 14, 2021
1 parent 0556e6b commit 0f35700
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/src/test/java/org/mozilla/fenix/home/HomeFragmentTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import mozilla.components.browser.menu.view.MenuButton
import org.junit.Assert
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.utils.Settings
Expand All @@ -32,8 +31,8 @@ class HomeFragmentTest {

homeFragment = spyk(HomeFragment())

every { homeFragment.context } returns context
every { context.settings() } returns settings
every { homeFragment.context } answers { context }
every { context.settings() } answers { settings }
}

@Test
Expand All @@ -46,7 +45,6 @@ class HomeFragmentTest {
Assert.assertNull(topSitesConfig.frecencyConfig)
}

@Ignore("See https://github.com/mozilla-mobile/fenix/issues/20795")
@Test
fun `GIVEN showTopFrecentSites is true WHEN getTopSitesConfig is called THEN it returns TopSitesConfig with non-null frecencyConfig`() {
every { context.settings().showTopFrecentSites } returns true
Expand Down

0 comments on commit 0f35700

Please sign in to comment.