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:
Dave Severns 2024-11-11 10:31:21 -05:00 committed by GitHub
parent dae50a7b88
commit dfeb87be10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 0 deletions

View file

@ -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)
}

View file

@ -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 =