mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Store session data in a secure way (#98)
* Replace SessionData DataStore with an encrypted SQLite DB. --------- Co-authored-by: Benoit Marty <benoit@matrix.org>
This commit is contained in:
committed by
GitHub
parent
381bd3fd3f
commit
6677f80abe
+5
-4
@@ -23,8 +23,9 @@ import app.cash.molecule.moleculeFlow
|
||||
import app.cash.turbine.test
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import io.element.android.libraries.architecture.Async
|
||||
import io.element.android.libraries.matrix.core.SessionId
|
||||
import io.element.android.libraries.matrixtest.A_SESSION_ID
|
||||
import io.element.android.libraries.matrixtest.A_THROWABLE
|
||||
import io.element.android.libraries.matrixtest.A_USER_ID
|
||||
import io.element.android.libraries.matrixtest.FakeMatrixClient
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.test.runTest
|
||||
@@ -34,7 +35,7 @@ class LogoutPreferencePresenterTest {
|
||||
@Test
|
||||
fun `present - initial state`() = runTest {
|
||||
val presenter = LogoutPreferencePresenter(
|
||||
FakeMatrixClient(SessionId("sessionId")),
|
||||
FakeMatrixClient(A_SESSION_ID),
|
||||
)
|
||||
moleculeFlow(RecompositionClock.Immediate) {
|
||||
presenter.present()
|
||||
@@ -47,7 +48,7 @@ class LogoutPreferencePresenterTest {
|
||||
@Test
|
||||
fun `present - logout`() = runTest {
|
||||
val presenter = LogoutPreferencePresenter(
|
||||
FakeMatrixClient(SessionId("sessionId")),
|
||||
FakeMatrixClient(A_SESSION_ID),
|
||||
)
|
||||
moleculeFlow(RecompositionClock.Immediate) {
|
||||
presenter.present()
|
||||
@@ -63,7 +64,7 @@ class LogoutPreferencePresenterTest {
|
||||
|
||||
@Test
|
||||
fun `present - logout with error`() = runTest {
|
||||
val matrixClient = FakeMatrixClient(SessionId("sessionId"))
|
||||
val matrixClient = FakeMatrixClient(A_SESSION_ID)
|
||||
val presenter = LogoutPreferencePresenter(
|
||||
matrixClient,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user