diff --git a/app/src/main/kotlin/com/bitwarden/authenticator/ui/authenticator/feature/itemlisting/ItemListingViewModel.kt b/app/src/main/kotlin/com/bitwarden/authenticator/ui/authenticator/feature/itemlisting/ItemListingViewModel.kt index 209edbd56..7f1a68299 100644 --- a/app/src/main/kotlin/com/bitwarden/authenticator/ui/authenticator/feature/itemlisting/ItemListingViewModel.kt +++ b/app/src/main/kotlin/com/bitwarden/authenticator/ui/authenticator/feature/itemlisting/ItemListingViewModel.kt @@ -162,11 +162,6 @@ class ItemListingViewModel @Inject constructor( private fun handleItemClick(authCode: String) { clipboardManager.setText(authCode) - sendEvent( - ItemListingEvent.ShowToast( - message = R.string.value_has_been_copied.asText(authCode), - ), - ) } private fun handleEditItemClick(itemId: String) { diff --git a/app/src/test/java/com/bitwarden/authenticator/ui/authenticator/feature/itemlisting/ItemListingViewModelTest.kt b/app/src/test/java/com/bitwarden/authenticator/ui/authenticator/feature/itemlisting/ItemListingViewModelTest.kt index a077f0347..318224bad 100644 --- a/app/src/test/java/com/bitwarden/authenticator/ui/authenticator/feature/itemlisting/ItemListingViewModelTest.kt +++ b/app/src/test/java/com/bitwarden/authenticator/ui/authenticator/feature/itemlisting/ItemListingViewModelTest.kt @@ -435,25 +435,20 @@ class ItemListingViewModelTest : BaseViewModelTest() { @Test fun `should copy text to clipboard when DropdownMenuClick COPY is triggered`() = runTest { val viewModel = createViewModel() - val testId = "123456" - every { clipboardManager.setText(text = testId) } just runs + every { clipboardManager.setText(text = LOCAL_CODE.authCode) } just runs viewModel.eventFlow.test { viewModel.trySendAction( - ItemListingAction.DropdownMenuClick(VaultDropdownMenuAction.COPY, LOCAL_CODE), + ItemListingAction.DropdownMenuClick( + menuAction = VaultDropdownMenuAction.COPY, + item = LOCAL_CODE, + ), ) verify(exactly = 1) { clipboardManager.setText(text = LOCAL_CODE.authCode) } - - assertEquals( - ItemListingEvent.ShowToast( - message = R.string.value_has_been_copied.asText(testId), - ), - awaitItem(), - ) } } @@ -485,7 +480,10 @@ class ItemListingViewModelTest : BaseViewModelTest() { ) viewModel.trySendAction( - ItemListingAction.DropdownMenuClick(VaultDropdownMenuAction.DELETE, LOCAL_CODE), + ItemListingAction.DropdownMenuClick( + menuAction = VaultDropdownMenuAction.DELETE, + item = LOCAL_CODE, + ), ) assertEquals(