From 5070c12a7bbbe09660f07bae364e3f39cdeb5eef Mon Sep 17 00:00:00 2001 From: Arturo Mejia Date: Wed, 21 Oct 2020 10:25:25 -0400 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/16019 - Fix intermittent test failure TrackingProtectionPolicyFactoryTest (https://github.com/mozilla-mobile/fenix/pull/16056) --- .../components/TrackingProtectionPolicyFactoryTest.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/test/java/org/mozilla/fenix/components/TrackingProtectionPolicyFactoryTest.kt b/app/src/test/java/org/mozilla/fenix/components/TrackingProtectionPolicyFactoryTest.kt index 518690cc30..a9a40ff986 100644 --- a/app/src/test/java/org/mozilla/fenix/components/TrackingProtectionPolicyFactoryTest.kt +++ b/app/src/test/java/org/mozilla/fenix/components/TrackingProtectionPolicyFactoryTest.kt @@ -9,18 +9,25 @@ import org.junit.Assert.assertArrayEquals import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue +import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.mozilla.fenix.Config import org.mozilla.fenix.FeatureFlags import org.mozilla.fenix.R import org.mozilla.fenix.ReleaseChannel -import org.mozilla.fenix.utils.Settings import org.mozilla.fenix.helpers.FenixRobolectricTestRunner +import org.mozilla.fenix.utils.Settings @RunWith(FenixRobolectricTestRunner::class) class TrackingProtectionPolicyFactoryTest { + @Before + fun setup() { + mockkObject(Config) + every { Config.channel } returns ReleaseChannel.Nightly + } + @Test fun `WHEN useStrictMode is true then SHOULD return strict mode`() { val expected = TrackingProtectionPolicy.strict()