diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/util/VaultItemListingStateExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/util/VaultItemListingStateExtensions.kt index e285b30ba..e9e86a03f 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/util/VaultItemListingStateExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/util/VaultItemListingStateExtensions.kt @@ -37,8 +37,8 @@ fun VaultItemListingState.ItemListingType.Vault.toVaultItemCipherType(): VaultIt is VaultItemListingState.ItemListingType.Vault.Identity -> VaultItemCipherType.IDENTITY is VaultItemListingState.ItemListingType.Vault.SecureNote -> VaultItemCipherType.SECURE_NOTE is VaultItemListingState.ItemListingType.Vault.Login -> VaultItemCipherType.LOGIN + is VaultItemListingState.ItemListingType.Vault.Collection -> VaultItemCipherType.LOGIN is VaultItemListingState.ItemListingType.Vault.Trash, - is VaultItemListingState.ItemListingType.Vault.Collection, is VaultItemListingState.ItemListingType.Vault.Folder, -> throw IllegalStateException("Cannot create vault item from this VaultItemListingState!") } diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/util/VaultItemListingStateExtensionsTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/util/VaultItemListingStateExtensionsTest.kt index 0950ec9ba..0485bf6ee 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/util/VaultItemListingStateExtensionsTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/util/VaultItemListingStateExtensionsTest.kt @@ -118,6 +118,7 @@ class VaultItemListingStateExtensionsTest { VaultItemListingState.ItemListingType.Vault.Identity, VaultItemListingState.ItemListingType.Vault.SecureNote, VaultItemListingState.ItemListingType.Vault.Login, + VaultItemListingState.ItemListingType.Vault.Collection(collectionId = "mockId"), ) val result = itemListingTypes.map { it.toVaultItemCipherType() } @@ -128,6 +129,7 @@ class VaultItemListingStateExtensionsTest { VaultItemCipherType.IDENTITY, VaultItemCipherType.SECURE_NOTE, VaultItemCipherType.LOGIN, + VaultItemCipherType.LOGIN, ), result, ) @@ -137,9 +139,6 @@ class VaultItemListingStateExtensionsTest { fun `toVaultItemCipherType should throw an exception for unsupported ItemListingTypes`() { val itemListingTypes = listOf( VaultItemListingState.ItemListingType.Vault.Trash, - VaultItemListingState.ItemListingType.Vault.Collection( - collectionId = "mockId", - ), VaultItemListingState.ItemListingType.Vault.Folder( folderId = "mockId", ),