Clean up some minor detekt issues (#3425)

This commit is contained in:
David Perez 2024-07-09 11:32:57 -05:00 committed by GitHub
parent 65237c18d7
commit 0dc606b470
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View file

@ -144,19 +144,20 @@ class CipherViewExtensionsTest {
.copy(currentCipher = cipherView),
type = createLoginContent(isEmpty = false).copy(
isPremiumUser = isPremiumUser,
canViewTotpCode = false
canViewTotpCode = false,
),
),
viewState,
)
}
@Suppress("MaxLineLength")
@Test
fun `toViewState should transform full CipherView into ViewState Login Content without premium but with org totp access`() {
val isPremiumUser = false
val cipherView = createCipherView(
type = CipherType.LOGIN,
isEmpty = false
isEmpty = false,
).copy(organizationUseTotp = true)
val viewState = cipherView.toViewState(
previousState = null,
@ -177,7 +178,7 @@ class CipherViewExtensionsTest {
.copy(currentCipher = cipherView),
type = createLoginContent(isEmpty = false).copy(
isPremiumUser = isPremiumUser,
canViewTotpCode = true
canViewTotpCode = true,
),
),
viewState,

View file

@ -405,6 +405,7 @@ class VerificationCodeViewModelTest : BaseViewModelTest() {
)
}
@Suppress("MaxLineLength")
@Test
fun `AuthCodeState Loaded with non premium user and no org TOTP enabled should cause navigate back`() =
runTest {
@ -426,6 +427,7 @@ class VerificationCodeViewModelTest : BaseViewModelTest() {
}
}
@Suppress("MaxLineLength")
@Test
fun `AuthCodeState Loaded with non premium user and one org TOTP enabled should return correct state`() =
runTest {
@ -441,8 +443,9 @@ class VerificationCodeViewModelTest : BaseViewModelTest() {
),
)
val displayItems =
(viewModel.stateFlow.value.viewState as? VerificationCodeState.ViewState.Content)?.verificationCodeDisplayItems
val displayItems = (viewModel.stateFlow.value.viewState as?
VerificationCodeState.ViewState.Content)
?.verificationCodeDisplayItems
assertEquals(1, displayItems?.size)
}