For #17073: Stop observers after test run

This commit is contained in:
Christian Sadilek 2020-12-24 09:55:08 -05:00
parent 5445e61b6a
commit 801ce85898
2 changed files with 12 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import mozilla.components.browser.state.store.BrowserStore
import mozilla.components.feature.app.links.AppLinksUseCases
import mozilla.components.support.test.ext.joinBlocking
import mozilla.components.support.test.rule.MainCoroutineRule
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@ -77,6 +78,11 @@ class OpenInAppOnboardingObserverTest {
every { openInAppOnboardingObserver.createInfoBanner() } returns infoBanner
}
@After
fun teardown() {
openInAppOnboardingObserver.stop()
}
@Test
fun `GIVEN user configured to open links in external app WHEN page finishes loading THEN do not show banner`() {
every { settings.openLinksInExternalApp } returns true

View File

@ -20,6 +20,7 @@ import mozilla.components.browser.state.store.BrowserStore
import mozilla.components.feature.pwa.WebAppUseCases
import mozilla.components.support.test.ext.joinBlocking
import mozilla.components.support.test.rule.MainCoroutineRule
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@ -66,6 +67,11 @@ class PwaOnboardingObserverTest {
)
}
@After
fun teardown() {
pwaOnboardingObserver.stop()
}
@Test
fun `GIVEN cfr should not yet be shown WHEN installable page is loaded THEN counter is incremented`() {
every { webAppUseCases.isInstallable() } returns true