mirror of
https://github.com/bitwarden/android.git
synced 2026-08-26 22:04:07 -05:00
BWA-144 - Consolidate feature flags for sync between the Password Manager Authenticator (#331)
This commit is contained in:
+1
-1
@@ -45,7 +45,7 @@ sealed class FlagKey<out T : Any> {
|
||||
* Indicates whether syncing with the main Bitwarden password manager app should be enabled..
|
||||
*/
|
||||
data object PasswordManagerSync : FlagKey<Boolean>() {
|
||||
override val keyName: String = "enable-password-manager-sync-android"
|
||||
override val keyName: String = "enable-pm-bwa-sync"
|
||||
override val defaultValue: Boolean = false
|
||||
override val isRemotelyConfigured: Boolean = true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.bitwarden.authenticator.data.platform.manager
|
||||
|
||||
import com.bitwarden.authenticator.data.platform.manager.model.FlagKey
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
import org.junit.jupiter.api.Assertions.assertFalse
|
||||
import org.junit.jupiter.api.Assertions.assertTrue
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
class FlagKeyTest {
|
||||
@Test
|
||||
fun `Feature flags have the correct key name set`() {
|
||||
assertEquals(
|
||||
FlagKey.BitwardenAuthenticationEnabled.keyName,
|
||||
"bitwarden-authentication-enabled",
|
||||
)
|
||||
assertEquals(
|
||||
FlagKey.PasswordManagerSync.keyName,
|
||||
"enable-pm-bwa-sync",
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `All feature flags have the correct default value set`() {
|
||||
assertTrue(
|
||||
listOf(
|
||||
FlagKey.BitwardenAuthenticationEnabled,
|
||||
FlagKey.PasswordManagerSync,
|
||||
).all {
|
||||
!it.defaultValue
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `All feature flags are correctly set to be remotely configured`() {
|
||||
assertTrue(FlagKey.PasswordManagerSync.isRemotelyConfigured)
|
||||
assertFalse(FlagKey.BitwardenAuthenticationEnabled.isRemotelyConfigured)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user