mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 08:15:02 +00:00
* Fix #7181: Remove back arrow from device verified screen and use 'Done' text * Update screenshots * Fix failing Maestro test by tapping 'Done' instead of 'Continue' --------- Co-authored-by: ElementBot <android@element.io> Co-authored-by: thirumani-vihaan <your-github-email@example.com>
This commit is contained in:
@@ -16,4 +16,4 @@ appId: ${MAESTRO_APP_ID}
|
|||||||
- extendedWaitUntil:
|
- extendedWaitUntil:
|
||||||
visible: "Device verified"
|
visible: "Device verified"
|
||||||
timeout: 30000
|
timeout: 30000
|
||||||
- tapOn: "Continue"
|
- tapOn: "Done"
|
||||||
|
|||||||
+9
-6
@@ -66,7 +66,8 @@ fun OutgoingVerificationView(
|
|||||||
fun cancelOrResetFlow() {
|
fun cancelOrResetFlow() {
|
||||||
when (step) {
|
when (step) {
|
||||||
is Step.Canceled -> state.eventSink(OutgoingVerificationViewEvents.Reset)
|
is Step.Canceled -> state.eventSink(OutgoingVerificationViewEvents.Reset)
|
||||||
Step.Initial, Step.Completed -> onBack()
|
Step.Initial -> onBack()
|
||||||
|
Step.Completed -> onFinish()
|
||||||
Step.Ready, is Step.AwaitingOtherDeviceResponse -> state.eventSink(OutgoingVerificationViewEvents.Cancel)
|
Step.Ready, is Step.AwaitingOtherDeviceResponse -> state.eventSink(OutgoingVerificationViewEvents.Cancel)
|
||||||
is Step.Verifying -> {
|
is Step.Verifying -> {
|
||||||
if (!step.state.isLoading()) {
|
if (!step.state.isLoading()) {
|
||||||
@@ -96,7 +97,9 @@ fun OutgoingVerificationView(
|
|||||||
TopAppBar(
|
TopAppBar(
|
||||||
title = {},
|
title = {},
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
BackButton(onClick = ::cancelOrResetFlow)
|
if (step !is Step.Completed) {
|
||||||
|
BackButton(onClick = ::cancelOrResetFlow)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
colors = topAppBarColors(containerColor = Color.Transparent),
|
colors = topAppBarColors(containerColor = Color.Transparent),
|
||||||
)
|
)
|
||||||
@@ -108,7 +111,7 @@ fun OutgoingVerificationView(
|
|||||||
OutgoingVerificationBottomMenu(
|
OutgoingVerificationBottomMenu(
|
||||||
state = state,
|
state = state,
|
||||||
onCancelClick = ::cancelOrResetFlow,
|
onCancelClick = ::cancelOrResetFlow,
|
||||||
onContinueClick = onFinish,
|
onDoneClick = onFinish,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
isScrollable = true,
|
isScrollable = true,
|
||||||
@@ -244,7 +247,7 @@ private fun ContentInitial(
|
|||||||
private fun OutgoingVerificationBottomMenu(
|
private fun OutgoingVerificationBottomMenu(
|
||||||
state: OutgoingVerificationState,
|
state: OutgoingVerificationState,
|
||||||
onCancelClick: () -> Unit,
|
onCancelClick: () -> Unit,
|
||||||
onContinueClick: () -> Unit,
|
onDoneClick: () -> Unit,
|
||||||
) {
|
) {
|
||||||
val eventSink = state.eventSink
|
val eventSink = state.eventSink
|
||||||
when (val step = state.step) {
|
when (val step = state.step) {
|
||||||
@@ -313,8 +316,8 @@ private fun OutgoingVerificationBottomMenu(
|
|||||||
VerificationBottomMenu {
|
VerificationBottomMenu {
|
||||||
Button(
|
Button(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
text = stringResource(CommonStrings.action_continue),
|
text = stringResource(CommonStrings.action_done),
|
||||||
onClick = onContinueClick,
|
onClick = onDoneClick,
|
||||||
)
|
)
|
||||||
InvisibleButton()
|
InvisibleButton()
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -99,10 +99,10 @@ class OutgoingVerificationViewTest : RobolectricTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `back key pressed - on Completed exits the flow`() = runAndroidComposeUiTest {
|
fun `back key pressed - on Completed finishes the flow`() = runAndroidComposeUiTest {
|
||||||
ensureCalledOnce { callback ->
|
ensureCalledOnce { callback ->
|
||||||
setOutgoingVerificationView(
|
setOutgoingVerificationView(
|
||||||
onBack = callback,
|
onFinished = callback,
|
||||||
state = anOutgoingVerificationState(
|
state = anOutgoingVerificationState(
|
||||||
step = OutgoingVerificationState.Step.Completed,
|
step = OutgoingVerificationState.Step.Completed,
|
||||||
),
|
),
|
||||||
@@ -112,7 +112,7 @@ class OutgoingVerificationViewTest : RobolectricTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `when flow is completed and the user clicks on the continue button, the expected callback is invoked`() = runAndroidComposeUiTest {
|
fun `when flow is completed and the user clicks on the done button, the expected callback is invoked`() = runAndroidComposeUiTest {
|
||||||
val eventsRecorder = EventsRecorder<OutgoingVerificationViewEvents>(expectEvents = false)
|
val eventsRecorder = EventsRecorder<OutgoingVerificationViewEvents>(expectEvents = false)
|
||||||
ensureCalledOnce { callback ->
|
ensureCalledOnce { callback ->
|
||||||
setOutgoingVerificationView(
|
setOutgoingVerificationView(
|
||||||
@@ -122,7 +122,7 @@ class OutgoingVerificationViewTest : RobolectricTest() {
|
|||||||
),
|
),
|
||||||
onFinished = callback,
|
onFinished = callback,
|
||||||
)
|
)
|
||||||
clickOn(CommonStrings.action_continue)
|
clickOn(CommonStrings.action_done)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user