mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
Bug 1830304 - Set browsing mode when redesigned onboarding is enabled
This commit is contained in:
parent
2b1fae8ada
commit
8bf1aeeca8
@ -40,8 +40,9 @@ class CurrentMode(
|
||||
) : AccountObserver {
|
||||
|
||||
private val accountManager by lazy { context.components.backgroundServices.accountManager }
|
||||
private val settings by lazy { context.components.settings }
|
||||
|
||||
fun getCurrentMode() = if (onboarding.userHasBeenOnboarded()) {
|
||||
fun getCurrentMode() = if (onboarding.userHasBeenOnboarded() || settings.junoOnboardingEnabled) {
|
||||
Mode.fromBrowsingMode(browsingModeManager.mode)
|
||||
} else {
|
||||
val account = accountManager.authenticatedAccount()
|
||||
|
@ -67,6 +67,15 @@ class ModeTest {
|
||||
assertEquals(Mode.Private, currentMode.getCurrentMode())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `get current browsing mode when userHasBeenOnboarded is false and juno onboarding is enabled`() {
|
||||
every { onboarding.userHasBeenOnboarded() } returns false
|
||||
every { context.components.settings.junoOnboardingEnabled } returns true
|
||||
every { browsingModeManager.mode } returns BrowsingMode.Normal
|
||||
|
||||
assertEquals(Mode.Normal, currentMode.getCurrentMode())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `get current onboarding mode when signed in`() {
|
||||
every { onboarding.userHasBeenOnboarded() } returns false
|
||||
|
Loading…
Reference in New Issue
Block a user