mirror of
https://github.com/bitwarden/android.git
synced 2024-12-18 07:11:51 +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() {
|
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)
|
sendEvent(SetupUnlockEvent.NavigateBack)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -352,6 +352,21 @@ class SetupUnlockViewModelTest : BaseViewModelTest() {
|
||||||
awaitItem(),
|
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(
|
private fun createViewModel(
|
||||||
|
|
Loading…
Reference in a new issue