Skip to content

Commit

Permalink
making use of fake session id for user id assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
ouchadam committed Mar 3, 2022
1 parent aa3f1b0 commit 6b04efd
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class SharedSecureStorageViewModelTest {
val mvrxTestRule = MvRxTestRule()

private val stringProvider = FakeStringProvider()
private val session = FakeSession()
private val fakeSession = FakeSession()
val args = SharedSecureStorageActivity.Args(keyId = null, emptyList(), "alias")

@Test
Expand Down Expand Up @@ -164,7 +164,7 @@ class SharedSecureStorageViewModelTest {
return SharedSecureStorageViewModel(
SharedSecureStorageViewState(args),
stringProvider.instance,
session
fakeSession
)
}

Expand All @@ -175,15 +175,15 @@ class SharedSecureStorageViewModelTest {
step = step,
activeDeviceCount = 0,
showResetAllAction = false,
userId = ""
userId = fakeSession.myUserId
)

private fun givenKey(keyInfo: KeyInfo) {
givenHasAccessToSecrets()
session.fakeSharedSecretStorageService._defaultKey = KeyInfoResult.Success(keyInfo)
fakeSession.fakeSharedSecretStorageService._defaultKey = KeyInfoResult.Success(keyInfo)
}

private fun givenHasAccessToSecrets() {
session.fakeSharedSecretStorageService.integrityResult = IntegrityResult.Success(passphraseBased = IGNORED_PASSPHRASE_INTEGRITY)
fakeSession.fakeSharedSecretStorageService.integrityResult = IntegrityResult.Success(passphraseBased = IGNORED_PASSPHRASE_INTEGRITY)
}
}

0 comments on commit 6b04efd

Please sign in to comment.