mirror of
https://github.com/bitwarden/android.git
synced 2026-05-27 15:15:33 -05:00
Add send delete confirmation dialog (#595)
This commit is contained in:
@@ -181,7 +181,7 @@ class AddSendScreenTest : BaseComposeTest() {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `on overflow remove Delete button click should send DeleteClick`() {
|
||||
fun `on overflow Delete button click should Display delete confirmation dialog`() {
|
||||
mutableStateFlow.value = DEFAULT_STATE.copy(
|
||||
addSendType = AddSendType.EditItem(sendItemId = "sendId"),
|
||||
)
|
||||
@@ -194,6 +194,31 @@ class AddSendScreenTest : BaseComposeTest() {
|
||||
.onNodeWithText("Delete")
|
||||
.performClick()
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithText("Are you sure you want to delete this Send?")
|
||||
.assert(hasAnyAncestor(isDialog()))
|
||||
.assertIsDisplayed()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `on delete confirmation dialog yes click should send DeleteClick`() {
|
||||
mutableStateFlow.value = DEFAULT_STATE.copy(
|
||||
addSendType = AddSendType.EditItem(sendItemId = "sendId"),
|
||||
)
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithContentDescription("More")
|
||||
.performClick()
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithText("Delete")
|
||||
.performClick()
|
||||
|
||||
composeTestRule
|
||||
.onNodeWithText("Yes")
|
||||
.assert(hasAnyAncestor(isDialog()))
|
||||
.performClick()
|
||||
|
||||
verify(exactly = 1) {
|
||||
viewModel.trySendAction(AddSendAction.DeleteClick)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user