mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 10:32:34 +00:00
PIN : Fix SetupPinPresenterTest
This commit is contained in:
+7
-2
@@ -30,6 +30,7 @@ import io.element.android.features.lockscreen.impl.setup.validation.PinValidator
|
|||||||
import io.element.android.features.lockscreen.impl.setup.validation.SetupPinFailure
|
import io.element.android.features.lockscreen.impl.setup.validation.SetupPinFailure
|
||||||
import io.element.android.libraries.matrix.test.core.aBuildMeta
|
import io.element.android.libraries.matrix.test.core.aBuildMeta
|
||||||
import io.element.android.tests.testutils.awaitLastSequentialItem
|
import io.element.android.tests.testutils.awaitLastSequentialItem
|
||||||
|
import io.element.android.tests.testutils.consumeItemsUntilPredicate
|
||||||
import kotlinx.coroutines.CompletableDeferred
|
import kotlinx.coroutines.CompletableDeferred
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
@@ -77,7 +78,9 @@ class SetupPinPresenterTest {
|
|||||||
assertThat(state.setupPinFailure).isNull()
|
assertThat(state.setupPinFailure).isNull()
|
||||||
state.eventSink(SetupPinEvents.OnPinEntryChanged(completePin))
|
state.eventSink(SetupPinEvents.OnPinEntryChanged(completePin))
|
||||||
}
|
}
|
||||||
awaitLastSequentialItem().also { state ->
|
consumeItemsUntilPredicate {
|
||||||
|
it.isConfirmationStep
|
||||||
|
}.last().also { state ->
|
||||||
state.choosePinEntry.assertText(completePin)
|
state.choosePinEntry.assertText(completePin)
|
||||||
state.confirmPinEntry.assertEmpty()
|
state.confirmPinEntry.assertEmpty()
|
||||||
assertThat(state.isConfirmationStep).isTrue()
|
assertThat(state.isConfirmationStep).isTrue()
|
||||||
@@ -96,7 +99,9 @@ class SetupPinPresenterTest {
|
|||||||
assertThat(state.setupPinFailure).isNull()
|
assertThat(state.setupPinFailure).isNull()
|
||||||
state.eventSink(SetupPinEvents.OnPinEntryChanged(completePin))
|
state.eventSink(SetupPinEvents.OnPinEntryChanged(completePin))
|
||||||
}
|
}
|
||||||
awaitLastSequentialItem().also { state ->
|
consumeItemsUntilPredicate {
|
||||||
|
it.isConfirmationStep
|
||||||
|
}.last().also { state ->
|
||||||
state.choosePinEntry.assertText(completePin)
|
state.choosePinEntry.assertText(completePin)
|
||||||
state.confirmPinEntry.assertEmpty()
|
state.confirmPinEntry.assertEmpty()
|
||||||
assertThat(state.isConfirmationStep).isTrue()
|
assertThat(state.isConfirmationStep).isTrue()
|
||||||
|
|||||||
Reference in New Issue
Block a user