mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Add unit test on QrLoginProgress.toStep()
This commit is contained in:
committed by
Benoit Marty
parent
e43491ac5a
commit
18461fa1f1
+29
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2024 New Vector Ltd.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
* Please see LICENSE in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.element.android.libraries.matrix.impl.auth.qrlogin
|
||||||
|
|
||||||
|
import com.google.common.truth.Truth.assertThat
|
||||||
|
import io.element.android.libraries.matrix.api.auth.qrlogin.QrCodeLoginStep
|
||||||
|
import org.junit.Test
|
||||||
|
import org.matrix.rustcomponents.sdk.QrLoginProgress
|
||||||
|
|
||||||
|
class QrLoginProgressExtensionsKtTest {
|
||||||
|
@Test
|
||||||
|
fun `mapping QrLoginProgress should return expected result`() {
|
||||||
|
assertThat(QrLoginProgress.Starting.toStep())
|
||||||
|
.isEqualTo(QrCodeLoginStep.Starting)
|
||||||
|
assertThat(QrLoginProgress.EstablishingSecureChannel(1u, "01").toStep())
|
||||||
|
.isEqualTo(QrCodeLoginStep.EstablishingSecureChannel("01"))
|
||||||
|
assertThat(QrLoginProgress.WaitingForToken("userCode").toStep())
|
||||||
|
.isEqualTo(QrCodeLoginStep.WaitingForToken("userCode"))
|
||||||
|
assertThat(QrLoginProgress.Done.toStep())
|
||||||
|
.isEqualTo(QrCodeLoginStep.Finished)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user