summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/SystemUI/tests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt
index 1990c8f644b4..18ace162696a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt
@@ -86,6 +86,22 @@ class AuthenticationInteractorTest : SysuiTestCase() {
underTest.biometricUnlock()
runCurrent()
+ // Toggle isUnlocked, twice.
+ //
+ // This is done because the underTest.isUnlocked flow doesn't receive values from
+ // just changing the state above; the actual isUnlocked state needs to change to
+ // cause the logic under test to "pick up" the current state again.
+ //
+ // It is done twice to make sure that we don't actually change the isUnlocked
+ // state from what it originally was.
+ utils.authenticationRepository().setUnlocked(
+ !utils.authenticationRepository().isUnlocked.value
+ )
+ runCurrent()
+ utils.authenticationRepository().setUnlocked(
+ !utils.authenticationRepository().isUnlocked.value
+ )
+ runCurrent()
assertThat(isUnlocked).isTrue()
}