Merge pull request #2429 from element-hq/feature/bma/testRecoveryKey
Test recovery key
This commit is contained in:
commit
a9c1fe5c42
34 changed files with 143 additions and 88 deletions
|
|
@ -42,6 +42,7 @@ dependencies {
|
|||
implementation(projects.libraries.matrixui)
|
||||
implementation(projects.libraries.designsystem)
|
||||
implementation(projects.libraries.uiStrings)
|
||||
implementation(projects.libraries.testtags)
|
||||
api(libs.statemachine)
|
||||
api(projects.features.securebackup.api)
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ import io.element.android.libraries.designsystem.theme.components.Icon
|
|||
import io.element.android.libraries.designsystem.theme.components.OutlinedTextField
|
||||
import io.element.android.libraries.designsystem.theme.components.Text
|
||||
import io.element.android.libraries.designsystem.theme.components.autofill
|
||||
import io.element.android.libraries.testtags.TestTags
|
||||
import io.element.android.libraries.testtags.testTag
|
||||
import io.element.android.libraries.ui.strings.CommonStrings
|
||||
|
||||
@Composable
|
||||
|
|
@ -169,6 +171,7 @@ private fun RecoveryKeyFormContent(
|
|||
OutlinedTextField(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.testTag(TestTags.recoveryKey)
|
||||
.autofill(
|
||||
autofillTypes = listOf(AutofillType.Password),
|
||||
onFill = { onChange(it) },
|
||||
|
|
|
|||
|
|
@ -31,5 +31,6 @@ interface VerifySessionEntryPoint : FeatureEntryPoint {
|
|||
|
||||
interface Callback : Plugin {
|
||||
fun onEnterRecoveryKey()
|
||||
fun onDone()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,14 +40,20 @@ class VerifySelfSessionNode @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun onDone() {
|
||||
plugins<VerifySessionEntryPoint.Callback>().forEach {
|
||||
it.onDone()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
override fun View(modifier: Modifier) {
|
||||
val state = presenter.present()
|
||||
VerifySelfSessionView(
|
||||
state = state,
|
||||
modifier = modifier,
|
||||
onEnterRecoveryKey = { onEnterRecoveryKey() },
|
||||
goBack = { navigateUp() }
|
||||
onEnterRecoveryKey = ::onEnterRecoveryKey,
|
||||
goBack = ::onDone,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue