BIT-1606: Add element IDs to DeleteAccountScreen (#1075)

This commit is contained in:
David Perez 2024-02-27 15:04:09 -06:00 committed by Álison Fernandes
parent cdda76bdae
commit 77e07f49ee

View file

@ -28,6 +28,8 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
import com.x8bit.bitwarden.R import com.x8bit.bitwarden.R
@ -150,6 +152,10 @@ fun DeleteAccountScreen(
onConfirmationClick = remember(viewModel) { onConfirmationClick = remember(viewModel) {
{ viewModel.trySendAction(DeleteAccountAction.DeleteAccountClick(it)) } { viewModel.trySendAction(DeleteAccountAction.DeleteAccountClick(it)) }
}, },
modifier = Modifier
.semantics { testTag = "DELETE ACCOUNT" }
.fillMaxWidth()
.padding(horizontal = 16.dp),
) )
Spacer(modifier = Modifier.height(12.dp)) Spacer(modifier = Modifier.height(12.dp))
BitwardenOutlinedButton( BitwardenOutlinedButton(
@ -158,6 +164,7 @@ fun DeleteAccountScreen(
{ viewModel.trySendAction(DeleteAccountAction.CancelClick) } { viewModel.trySendAction(DeleteAccountAction.CancelClick) }
}, },
modifier = Modifier modifier = Modifier
.semantics { testTag = "CANCEL" }
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) )
@ -169,6 +176,7 @@ fun DeleteAccountScreen(
@Composable @Composable
private fun DeleteAccountButton( private fun DeleteAccountButton(
onConfirmationClick: (masterPassword: String) -> Unit, onConfirmationClick: (masterPassword: String) -> Unit,
modifier: Modifier = Modifier,
) { ) {
var showPasswordDialog by remember { mutableStateOf(false) } var showPasswordDialog by remember { mutableStateOf(false) }
if (showPasswordDialog) { if (showPasswordDialog) {
@ -184,8 +192,6 @@ private fun DeleteAccountButton(
BitwardenErrorButton( BitwardenErrorButton(
label = stringResource(id = R.string.delete_account), label = stringResource(id = R.string.delete_account),
onClick = { showPasswordDialog = true }, onClick = { showPasswordDialog = true },
modifier = Modifier modifier = modifier,
.fillMaxWidth()
.padding(horizontal = 16.dp),
) )
} }