mirror of
https://github.com/bitwarden/android.git
synced 2024-11-21 17:05:44 +03:00
PM-13988 Hide the action card if the user makes a selection but does not click continue on setup unlock (#4249)
This commit is contained in:
parent
dae50a7b88
commit
dfeb87be10
2 changed files with 20 additions and 0 deletions
|
@ -76,6 +76,11 @@ class SetupUnlockViewModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun handleCloseClick() {
|
||||
// If the user has enabled biometric or PIN lock, but then closes the screen we
|
||||
// want to dismiss the action card.
|
||||
if (state.isContinueButtonEnabled) {
|
||||
firstTimeActionManager.storeShowUnlockSettingBadge(showBadge = false)
|
||||
}
|
||||
sendEvent(SetupUnlockEvent.NavigateBack)
|
||||
}
|
||||
|
||||
|
|
|
@ -352,8 +352,23 @@ class SetupUnlockViewModelTest : BaseViewModelTest() {
|
|||
awaitItem(),
|
||||
)
|
||||
}
|
||||
verify(exactly = 0) {
|
||||
firstTimeActionManager.storeShowUnlockSettingBadge(showBadge = false)
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("MaxLineLength")
|
||||
@Test
|
||||
fun `CloseClick action should update the first time state to false if continue button is enabled`() =
|
||||
runTest {
|
||||
val viewModel =
|
||||
createViewModel(state = DEFAULT_STATE.copy(isUnlockWithPinEnabled = true))
|
||||
viewModel.trySendAction(SetupUnlockAction.CloseClick)
|
||||
verify {
|
||||
firstTimeActionManager.storeShowUnlockSettingBadge(showBadge = false)
|
||||
}
|
||||
}
|
||||
|
||||
private fun createViewModel(
|
||||
state: SetupUnlockState? = null,
|
||||
): SetupUnlockViewModel =
|
||||
|
|
Loading…
Reference in a new issue