Some renaming.
This commit is contained in:
parent
21fafe2fc9
commit
922f65cc96
5 changed files with 7 additions and 7 deletions
|
|
@ -76,7 +76,7 @@ class SetupPinPresenter @Inject constructor(
|
||||||
if (confirmPinEntry == choosePinEntry) {
|
if (confirmPinEntry == choosePinEntry) {
|
||||||
pinCodeManager.createPinCode(confirmPinEntry.toText())
|
pinCodeManager.createPinCode(confirmPinEntry.toText())
|
||||||
} else {
|
} else {
|
||||||
setupPinFailure = SetupPinFailure.PinsDontMatch
|
setupPinFailure = SetupPinFailure.PinsDoNotMatch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -93,7 +93,7 @@ class SetupPinPresenter @Inject constructor(
|
||||||
}
|
}
|
||||||
SetupPinEvents.ClearFailure -> {
|
SetupPinEvents.ClearFailure -> {
|
||||||
when (setupPinFailure) {
|
when (setupPinFailure) {
|
||||||
is SetupPinFailure.PinsDontMatch -> {
|
is SetupPinFailure.PinsDoNotMatch -> {
|
||||||
choosePinEntry = choosePinEntry.clear()
|
choosePinEntry = choosePinEntry.clear()
|
||||||
confirmPinEntry = confirmPinEntry.clear()
|
confirmPinEntry = confirmPinEntry.clear()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ open class SetupPinStateProvider : PreviewParameterProvider<SetupPinState> {
|
||||||
choosePinEntry = PinEntry.createEmpty(4).fillWith("1789"),
|
choosePinEntry = PinEntry.createEmpty(4).fillWith("1789"),
|
||||||
confirmPinEntry = PinEntry.createEmpty(4).fillWith("1788"),
|
confirmPinEntry = PinEntry.createEmpty(4).fillWith("1788"),
|
||||||
isConfirmationStep = true,
|
isConfirmationStep = true,
|
||||||
creationFailure = SetupPinFailure.PinsDontMatch
|
creationFailure = SetupPinFailure.PinsDoNotMatch
|
||||||
),
|
),
|
||||||
aSetupPinState(
|
aSetupPinState(
|
||||||
choosePinEntry = PinEntry.createEmpty(4).fillWith("1111"),
|
choosePinEntry = PinEntry.createEmpty(4).fillWith("1111"),
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ private fun SetupPinContent(
|
||||||
private fun SetupPinFailure.content(): String {
|
private fun SetupPinFailure.content(): String {
|
||||||
return when (this) {
|
return when (this) {
|
||||||
SetupPinFailure.ForbiddenPin -> stringResource(id = R.string.screen_app_lock_setup_pin_forbidden_dialog_content)
|
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 {
|
private fun SetupPinFailure.title(): String {
|
||||||
return when (this) {
|
return when (this) {
|
||||||
SetupPinFailure.ForbiddenPin -> stringResource(id = R.string.screen_app_lock_setup_pin_forbidden_dialog_title)
|
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 {
|
sealed interface SetupPinFailure {
|
||||||
data object ForbiddenPin : SetupPinFailure
|
data object ForbiddenPin : SetupPinFailure
|
||||||
data object PinsDontMatch : SetupPinFailure
|
data object PinsDoNotMatch : SetupPinFailure
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ class SetupPinPresenterTest {
|
||||||
awaitLastSequentialItem().also { state ->
|
awaitLastSequentialItem().also { state ->
|
||||||
state.choosePinEntry.assertText(completePin)
|
state.choosePinEntry.assertText(completePin)
|
||||||
state.confirmPinEntry.assertText(mismatchedPin)
|
state.confirmPinEntry.assertText(mismatchedPin)
|
||||||
assertThat(state.setupPinFailure).isEqualTo(SetupPinFailure.PinsDontMatch)
|
assertThat(state.setupPinFailure).isEqualTo(SetupPinFailure.PinsDoNotMatch)
|
||||||
state.eventSink(SetupPinEvents.ClearFailure)
|
state.eventSink(SetupPinEvents.ClearFailure)
|
||||||
}
|
}
|
||||||
awaitLastSequentialItem().also { state ->
|
awaitLastSequentialItem().also { state ->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue