Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mchenani committed Jun 18, 2024
1 parent 9ccee3f commit f86fdaa
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import com.wire.kalium.logic.feature.conversation.GetAllContactsNotInConversatio
import com.wire.kalium.logic.feature.e2ei.CertificateRevocationListCheckWorker
import com.wire.kalium.logic.feature.e2ei.usecase.GetMLSClientIdentityUseCase
import com.wire.kalium.logic.feature.e2ei.usecase.GetMembersE2EICertificateStatusesUseCase
import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificateStatusUseCase
import com.wire.kalium.logic.feature.e2ei.usecase.IsOtherUserE2EIVerifiedUseCase
import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificatesUseCase
import com.wire.kalium.logic.feature.e2ei.usecase.ObserveCertificateRevocationForSelfClientUseCase
import com.wire.kalium.logic.feature.featureConfig.FeatureFlagsSyncWorker
Expand Down Expand Up @@ -217,7 +217,7 @@ class UserModule {

@ViewModelScoped
@Provides
fun provideGetUserE2eiCertificateStatusUseCase(userScope: UserScope): GetUserE2eiCertificateStatusUseCase =
fun provideGetUserE2eiCertificateStatusUseCase(userScope: UserScope): IsOtherUserE2EIVerifiedUseCase =
userScope.getUserE2eiCertificateStatus

@ViewModelScoped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ fun PreviewDeviceDetailsScreen() {
x509Identity = X509Identity(
displayName = "",
domain = "",
certificateDetail = "",
certificate = "",
serialNumber = "e5:d5:e6:75:7e:04:86:07:14:3c:a0:ed:9a:8d:e4:fd",
notBefore = Instant.DISTANT_PAST,
notAfter = Instant.DISTANT_FUTURE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fun PreviewEndToEndIdentityCertificateItem() {
x509Identity = X509Identity(
displayName = "",
domain = "",
certificateDetail = "",
certificate = "",
serialNumber = "e5:d5:e6:75:7e:04:86:07:14:3c:a0:ed:9a:8d:e4:fd",
notBefore = Instant.DISTANT_PAST,
notAfter = Instant.DISTANT_FUTURE
Expand All @@ -246,7 +246,7 @@ fun PreviewEndToEndIdentityCertificateSelfItem() {
x509Identity = X509Identity(
displayName = "",
domain = "",
certificateDetail = "",
certificate = "",
serialNumber = "e5:d5:e6:75:7e:04:86:07:14:3c:a0:ed:9a:8d:e4:fd",
notBefore = Instant.DISTANT_PAST,
notAfter = Instant.DISTANT_FUTURE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class E2eiCertificateDetailsViewModel @Inject constructor(
navArgs.certificateDetails.certificate

is E2EICertificateDetails.AfterLoginCertificateDetails ->
navArgs.certificateDetails.mlsClientIdentity.x509Identity!!.certificateDetail
navArgs.certificateDetails.mlsClientIdentity.x509Identity!!.certificate
}

fun userHandle() =
Expand All @@ -72,7 +72,7 @@ class E2eiCertificateDetailsViewModel @Inject constructor(
selfUserHandle

is E2EICertificateDetails.AfterLoginCertificateDetails ->
navArgs.certificateDetails.mlsClientIdentity.x509Identity!!.certificateDetail
navArgs.certificateDetails.mlsClientIdentity.x509Identity!!.certificate
}

fun getCertificateName(): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import com.wire.kalium.logic.feature.conversation.UpdateConversationArchivedStat
import com.wire.kalium.logic.feature.conversation.UpdateConversationMemberRoleResult
import com.wire.kalium.logic.feature.conversation.UpdateConversationMemberRoleUseCase
import com.wire.kalium.logic.feature.conversation.UpdateConversationMutedStatusUseCase
import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificateStatusUseCase
import com.wire.kalium.logic.feature.e2ei.usecase.IsOtherUserE2EIVerifiedUseCase
import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificatesUseCase
import com.wire.kalium.logic.feature.user.GetUserInfoResult
import com.wire.kalium.logic.feature.user.ObserveUserInfoUseCase
Expand Down Expand Up @@ -104,7 +104,7 @@ class OtherUserProfileScreenViewModel @Inject constructor(
private val fetchUsersClients: FetchUsersClientsFromRemoteUseCase,
private val clearConversationContentUseCase: ClearConversationContentUseCase,
private val updateConversationArchivedStatus: UpdateConversationArchivedStatusUseCase,
private val getUserE2eiCertificateStatus: GetUserE2eiCertificateStatusUseCase,
private val getUserE2eiCertificateStatus: IsOtherUserE2EIVerifiedUseCase,
private val getUserE2eiCertificates: GetUserE2eiCertificatesUseCase,
private val isOneToOneConversationCreated: IsOneToOneConversationCreatedUseCase,
savedStateHandle: SavedStateHandle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ import com.wire.kalium.logic.feature.conversation.UpdateConversationMemberRoleRe
import com.wire.kalium.logic.feature.conversation.UpdateConversationMemberRoleUseCase
import com.wire.kalium.logic.feature.conversation.UpdateConversationMutedStatusUseCase
import com.wire.kalium.logic.feature.e2ei.CertificateStatus
import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificateStatusResult
import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificateStatusUseCase
import com.wire.kalium.logic.feature.e2ei.usecase.IsOtherUserE2EIVerifiedUseCase
import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificatesUseCase
import com.wire.kalium.logic.feature.user.GetSelfUserUseCase
import com.wire.kalium.logic.feature.user.GetUserInfoResult
Expand Down Expand Up @@ -108,7 +107,7 @@ internal class OtherUserProfileViewModelArrangement {
lateinit var updateConversationArchivedStatus: UpdateConversationArchivedStatusUseCase

@MockK
lateinit var getUserE2eiCertificateStatus: GetUserE2eiCertificateStatusUseCase
lateinit var getUserE2eiCertificateStatus: IsOtherUserE2EIVerifiedUseCase

@MockK
lateinit var getUserE2eiCertificates: GetUserE2eiCertificatesUseCase
Expand Down Expand Up @@ -164,7 +163,7 @@ internal class OtherUserProfileViewModelArrangement {
coEvery { getOneToOneConversation(USER_ID) } returns flowOf(
GetOneToOneConversationUseCase.Result.Success(OtherUserProfileScreenViewModelTest.CONVERSATION)
)
coEvery { getUserE2eiCertificateStatus.invoke(any()) } returns GetUserE2eiCertificateStatusResult.Success(CertificateStatus.VALID)
coEvery { getUserE2eiCertificateStatus.invoke(any()) } returns true
coEvery { getUserE2eiCertificates.invoke(any()) } returns mapOf()
coEvery { isOneToOneConversationCreated.invoke(any()) } returns true
}
Expand Down

0 comments on commit f86fdaa

Please sign in to comment.