2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-15 18:12:54 +00:00
With the Fennec -> Fenix migration complete there is no other Mozilla
application that would serve as a custom account provider hence the automatic
signin would not be possible.
Make this more obvious by commenting out the code that would trigger an
onboarding banner for it but keep the code in the app for when https://github.com/mozilla-mobile/fenix/issues/15694 would add
to Fenix the ability to serve as a custom account provider.
This commit is contained in:
Mugurell 2020-11-04 17:23:19 +02:00 committed by GitHub
parent 0a8d8cfbf0
commit f3d5862668
2 changed files with 17 additions and 19 deletions

View File

@ -59,12 +59,10 @@ class CurrentMode(
if (account != null) {
Mode.Onboarding(OnboardingState.SignedIn)
} else {
val availableAccounts = accountManager.shareableAccounts(context)
if (availableAccounts.isEmpty()) {
Mode.Onboarding(OnboardingState.SignedOutNoAutoSignIn)
} else {
Mode.Onboarding(OnboardingState.SignedOutCanAutoSignIn(availableAccounts[0]))
}
// The following other state is effectively disabled - #6521
// Code still exists in app for when it will be used again - #15694
// Mode.Onboarding(OnboardingState.SignedOutCanAutoSignIn(accountManager.shareableAccounts(context)[0]))
}
}

View File

@ -10,7 +10,6 @@ import io.mockk.mockk
import io.mockk.spyk
import io.mockk.verify
import mozilla.components.service.fxa.manager.FxaAccountManager
import mozilla.components.service.fxa.sharing.ShareableAccount
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
@ -79,18 +78,19 @@ class ModeTest {
assertEquals(Mode.Onboarding(OnboardingState.SignedOutNoAutoSignIn), currentMode.getCurrentMode())
}
@Test
fun `get current onboarding mode when can auto sign in`() {
val shareableAccount: ShareableAccount = mockk()
every { onboarding.userHasBeenOnboarded() } returns false
every { accountManager.authenticatedAccount() } returns null
every { accountManager.shareableAccounts(context) } returns listOf(shareableAccount)
assertEquals(
Mode.Onboarding(OnboardingState.SignedOutCanAutoSignIn(shareableAccount)),
currentMode.getCurrentMode()
)
}
// Temporarily disabled. See #6521
// @Test
// fun `get current onboarding mode when can auto sign in`() {
// val shareableAccount: ShareableAccount = mockk()
// every { onboarding.userHasBeenOnboarded() } returns false
// every { accountManager.authenticatedAccount() } returns null
// every { accountManager.shareableAccounts(context) } returns listOf(shareableAccount)
//
// assertEquals(
// Mode.Onboarding(OnboardingState.SignedOutCanAutoSignIn(shareableAccount)),
// currentMode.getCurrentMode()
// )
// }
@Test
fun `emit mode change`() {