Some renaming.
This commit is contained in:
@@ -76,7 +76,7 @@ class SetupPinPresenter @Inject constructor(
|
||||
if (confirmPinEntry == choosePinEntry) {
|
||||
pinCodeManager.createPinCode(confirmPinEntry.toText())
|
||||
} else {
|
||||
setupPinFailure = SetupPinFailure.PinsDontMatch
|
||||
setupPinFailure = SetupPinFailure.PinsDoNotMatch
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ class SetupPinPresenter @Inject constructor(
|
||||
}
|
||||
SetupPinEvents.ClearFailure -> {
|
||||
when (setupPinFailure) {
|
||||
is SetupPinFailure.PinsDontMatch -> {
|
||||
is SetupPinFailure.PinsDoNotMatch -> {
|
||||
choosePinEntry = choosePinEntry.clear()
|
||||
confirmPinEntry = confirmPinEntry.clear()
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ open class SetupPinStateProvider : PreviewParameterProvider<SetupPinState> {
|
||||
choosePinEntry = PinEntry.createEmpty(4).fillWith("1789"),
|
||||
confirmPinEntry = PinEntry.createEmpty(4).fillWith("1788"),
|
||||
isConfirmationStep = true,
|
||||
creationFailure = SetupPinFailure.PinsDontMatch
|
||||
creationFailure = SetupPinFailure.PinsDoNotMatch
|
||||
),
|
||||
aSetupPinState(
|
||||
choosePinEntry = PinEntry.createEmpty(4).fillWith("1111"),
|
||||
|
||||
@@ -136,7 +136,7 @@ private fun SetupPinContent(
|
||||
private fun SetupPinFailure.content(): String {
|
||||
return when (this) {
|
||||
SetupPinFailure.ForbiddenPin -> stringResource(id = R.string.screen_app_lock_setup_pin_forbidden_dialog_content)
|
||||
SetupPinFailure.PinsDontMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_content)
|
||||
SetupPinFailure.PinsDoNotMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_content)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ private fun SetupPinFailure.content(): String {
|
||||
private fun SetupPinFailure.title(): String {
|
||||
return when (this) {
|
||||
SetupPinFailure.ForbiddenPin -> stringResource(id = R.string.screen_app_lock_setup_pin_forbidden_dialog_title)
|
||||
SetupPinFailure.PinsDontMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_title)
|
||||
SetupPinFailure.PinsDoNotMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_title)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,5 +18,5 @@ package io.element.android.features.lockscreen.impl.setup.pin.validation
|
||||
|
||||
sealed interface SetupPinFailure {
|
||||
data object ForbiddenPin : SetupPinFailure
|
||||
data object PinsDontMatch : SetupPinFailure
|
||||
data object PinsDoNotMatch : SetupPinFailure
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class SetupPinPresenterTest {
|
||||
awaitLastSequentialItem().also { state ->
|
||||
state.choosePinEntry.assertText(completePin)
|
||||
state.confirmPinEntry.assertText(mismatchedPin)
|
||||
assertThat(state.setupPinFailure).isEqualTo(SetupPinFailure.PinsDontMatch)
|
||||
assertThat(state.setupPinFailure).isEqualTo(SetupPinFailure.PinsDoNotMatch)
|
||||
state.eventSink(SetupPinEvents.ClearFailure)
|
||||
}
|
||||
awaitLastSequentialItem().also { state ->
|
||||
|
||||
Reference in New Issue
Block a user