PIN : add test for SetupPinPresenter
This commit is contained in:
parent
4fbe32a6da
commit
6230d9d48b
7 changed files with 123 additions and 13 deletions
|
|
@ -20,6 +20,6 @@ import io.element.android.features.lockscreen.impl.unlock.numpad.PinKeypadModel
|
|||
|
||||
sealed interface PinUnlockEvents {
|
||||
data class OnPinKeypadPressed(val pinKeypadModel: PinKeypadModel) : PinUnlockEvents
|
||||
data object Unlock : PinUnlockEvents
|
||||
data object OnForgetPin : PinUnlockEvents
|
||||
data object ClearSignOutPrompt : PinUnlockEvents
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ class PinUnlockPresenter @Inject constructor(
|
|||
|
||||
fun handleEvents(event: PinUnlockEvents) {
|
||||
when (event) {
|
||||
PinUnlockEvents.Unlock -> coroutineScope.launch { pinStateService.unlock() }
|
||||
is PinUnlockEvents.OnPinKeypadPressed -> {
|
||||
pinEntry = pinEntry.process(event.pinKeypadModel)
|
||||
if (pinEntry.isComplete()) {
|
||||
|
|
@ -61,6 +60,7 @@ class PinUnlockPresenter @Inject constructor(
|
|||
}
|
||||
}
|
||||
PinUnlockEvents.OnForgetPin -> showSignOutPrompt = true
|
||||
PinUnlockEvents.ClearSignOutPrompt -> showSignOutPrompt = false
|
||||
}
|
||||
}
|
||||
return PinUnlockState(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue