mirror of
https://github.com/bitwarden/android.git
synced 2026-03-21 13:52:07 -05:00
PM-18681 - Update Showing Coach Mark Tour Logic To Only Consider User's Personal Vault (#4821)
This commit is contained in:
@@ -311,7 +311,9 @@ class FirstTimeActionManagerImpl @Inject constructor(
|
||||
flow = this,
|
||||
flow2 = vaultDiskSource.getCiphers(activeUserId),
|
||||
) { currentValue, ciphers ->
|
||||
currentValue && ciphers.none { it.login != null }
|
||||
currentValue && ciphers.none {
|
||||
it.login != null && it.organizationId == null
|
||||
}
|
||||
}
|
||||
}
|
||||
.distinctUntilChanged()
|
||||
|
||||
@@ -330,9 +330,11 @@ class FirstTimeActionManagerTest {
|
||||
runTest {
|
||||
val mockJsonWithNoLogin = mockk<SyncResponseJson.Cipher> {
|
||||
every { login } returns null
|
||||
every { organizationId } returns null
|
||||
}
|
||||
val mockJsonWithLogin = mockk<SyncResponseJson.Cipher> {
|
||||
every { login } returns mockk()
|
||||
every { organizationId } returns null
|
||||
}
|
||||
fakeAuthDiskSource.userState = MOCK_USER_STATE
|
||||
// Enable feature flag so flow emits updates from disk.
|
||||
@@ -393,9 +395,11 @@ class FirstTimeActionManagerTest {
|
||||
runTest {
|
||||
val mockJsonWithNoLogin = mockk<SyncResponseJson.Cipher> {
|
||||
every { login } returns null
|
||||
every { organizationId } returns null
|
||||
}
|
||||
val mockJsonWithLogin = mockk<SyncResponseJson.Cipher> {
|
||||
every { login } returns mockk()
|
||||
every { organizationId } returns null
|
||||
}
|
||||
fakeAuthDiskSource.userState = MOCK_USER_STATE
|
||||
// Enable feature flag so flow emits updates from disk.
|
||||
@@ -418,6 +422,24 @@ class FirstTimeActionManagerTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `if there are login ciphers attached to an organization we should show coach marks`() =
|
||||
runTest {
|
||||
val mockJsonWithNoLoginAndWithOrganizationId = mockk<SyncResponseJson.Cipher> {
|
||||
every { login } returns mockk()
|
||||
every { organizationId } returns "1234"
|
||||
}
|
||||
fakeAuthDiskSource.userState = MOCK_USER_STATE
|
||||
// Enable feature flag so flow emits updates from disk.
|
||||
mutableOnboardingFeatureFlow.update { true }
|
||||
mutableCiphersListFlow.update {
|
||||
listOf(mockJsonWithNoLoginAndWithOrganizationId)
|
||||
}
|
||||
firstTimeActionManager.shouldShowGeneratorCoachMarkFlow.test {
|
||||
assertTrue(awaitItem())
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("MaxLineLength")
|
||||
@Test
|
||||
fun `markCoachMarkTourCompleted for the GENERATOR type sets the value to true in the disk source for should show generator coach mark`() {
|
||||
|
||||
Reference in New Issue
Block a user