mirror of
https://github.com/bitwarden/android.git
synced 2025-03-16 03:08:50 +03:00
Clean up some minor detekt issues (#3425)
This commit is contained in:
parent
65237c18d7
commit
0dc606b470
2 changed files with 9 additions and 5 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue