diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt index 15a867ef8..7d39fb478 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt @@ -471,7 +471,7 @@ class VaultAddEditViewModel @Inject constructor( } } - CustomFieldAction.DELETE -> { + CustomFieldAction.REMOVE -> { updateCommonContent { commonContent -> commonContent.copy( customFieldData = commonContent.customFieldData.filter { diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/model/CustomFieldAction.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/model/CustomFieldAction.kt index 67c1d3c70..672d7a7cb 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/model/CustomFieldAction.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/model/CustomFieldAction.kt @@ -12,5 +12,5 @@ enum class CustomFieldAction(val actionText: Text) { EDIT(R.string.edit.asText()), MOVE_UP(R.string.move_up.asText()), MOVE_DOWN(R.string.move_down.asText()), - DELETE(R.string.delete.asText()), + REMOVE(R.string.remove.asText()), } diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditScreenTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditScreenTest.kt index e05136db7..17f7a981d 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditScreenTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditScreenTest.kt @@ -15,6 +15,7 @@ import androidx.compose.ui.test.filterToOne import androidx.compose.ui.test.hasAnyAncestor import androidx.compose.ui.test.hasContentDescription import androidx.compose.ui.test.hasSetTextAction +import androidx.compose.ui.test.hasText import androidx.compose.ui.test.isDialog import androidx.compose.ui.test.isPopup import androidx.compose.ui.test.onAllNodesWithContentDescription @@ -1864,7 +1865,8 @@ class VaultAddEditScreenTest : BaseComposeTest() { .performClick() composeTestRule - .onNodeWithText("Name") + .onAllNodes(hasAnyAncestor(isDialog())) + .filterToOne(hasText("Name")) .performTextInput("TestLinked") composeTestRule @@ -2239,7 +2241,8 @@ class VaultAddEditScreenTest : BaseComposeTest() { .performClick() composeTestRule - .onNodeWithText("Name") + .onAllNodes(hasAnyAncestor(isDialog())) + .filterToOne(hasText("Name")) .performTextInput("TestText") composeTestRule @@ -2294,7 +2297,8 @@ class VaultAddEditScreenTest : BaseComposeTest() { .performClick() composeTestRule - .onNodeWithText("Name") + .onAllNodes(hasAnyAncestor(isDialog())) + .filterToOne(hasText("Name")) .performTextInput("TestBoolean") composeTestRule @@ -2329,7 +2333,8 @@ class VaultAddEditScreenTest : BaseComposeTest() { .performClick() composeTestRule - .onNodeWithText("Name") + .onAllNodes(hasAnyAncestor(isDialog())) + .filterToOne(hasText("Name")) .performTextInput("TestHidden") composeTestRule @@ -2443,7 +2448,7 @@ class VaultAddEditScreenTest : BaseComposeTest() { @Suppress("MaxLineLength") @Test - fun `clicking custom field edit icon and Delete option sends a CustomFieldActionSelect delete action`() { + fun `clicking custom field edit icon and Remove option sends a CustomFieldActionSelect remove action`() { mutableStateFlow.value = DEFAULT_STATE_SECURE_NOTES_CUSTOM_FIELDS composeTestRule @@ -2452,13 +2457,13 @@ class VaultAddEditScreenTest : BaseComposeTest() { .performClick() composeTestRule - .onNodeWithText("Delete") + .onNodeWithText("Remove") .performClick() verify { viewModel.trySendAction( VaultAddEditAction.Common.CustomFieldActionSelect( - customFieldAction = CustomFieldAction.DELETE, + customFieldAction = CustomFieldAction.REMOVE, customField = VaultAddEditState.Custom.BooleanField( itemId = "Test ID 1", name = "TestBoolean", diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt index 5797a8e74..7435839a9 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt @@ -2105,7 +2105,7 @@ class VaultAddEditViewModelTest : BaseViewModelTest() { } @Test - fun `CustomFieldActionSelect with delete action should delete the item`() = runTest { + fun `CustomFieldActionSelect with remove action should remove the item`() = runTest { val customFieldData = VaultAddEditState.Custom.BooleanField( "TestId 3", "Boolean Field", @@ -2136,7 +2136,7 @@ class VaultAddEditViewModelTest : BaseViewModelTest() { viewModel.actionChannel.trySend( VaultAddEditAction.Common.CustomFieldActionSelect( - CustomFieldAction.DELETE, + CustomFieldAction.REMOVE, customFieldData, ), )