mirror of
https://github.com/bitwarden/android.git
synced 2025-02-13 18:39:56 +03:00
QA-951: Adding missing IDs for Attachment rows (#4148)
This commit is contained in:
parent
b0885ff60a
commit
0ff2fe6d6a
3 changed files with 22 additions and 9 deletions
app/src/main/java/com/x8bit/bitwarden/ui/vault/feature
|
@ -65,7 +65,8 @@ fun AttachmentsContent(
|
|||
onDeleteClick = attachmentsHandlers.onDeleteClick,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp),
|
||||
.padding(horizontal = 16.dp)
|
||||
.testTag("AttachmentList"),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +93,8 @@ fun AttachmentsContent(
|
|||
textAlign = TextAlign.Center,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp),
|
||||
.padding(horizontal = 16.dp)
|
||||
.testTag("SelectedFileNameLabel"),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -103,7 +105,8 @@ fun AttachmentsContent(
|
|||
onClick = attachmentsHandlers.onChooseFileClick,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp),
|
||||
.padding(horizontal = 16.dp)
|
||||
.testTag("AttachmentSelectFileButton"),
|
||||
)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
|
@ -159,7 +162,9 @@ private fun AttachmentListEntry(
|
|||
style = BitwardenTheme.typography.bodyMedium,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.weight(1f),
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.testTag("AttachmentNameLabel"),
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
|
@ -168,7 +173,8 @@ private fun AttachmentListEntry(
|
|||
text = attachmentItem.displaySize,
|
||||
color = BitwardenTheme.colorScheme.text.primary,
|
||||
style = BitwardenTheme.typography.labelSmall,
|
||||
modifier = Modifier,
|
||||
modifier = Modifier
|
||||
.testTag("AttachmentSizeLabel"),
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
|
@ -177,6 +183,8 @@ private fun AttachmentListEntry(
|
|||
vectorIconRes = R.drawable.ic_trash,
|
||||
contentDescription = stringResource(id = R.string.delete),
|
||||
onClick = { shouldShowDeleteDialog = true },
|
||||
modifier = Modifier
|
||||
.testTag("AttachmentDeleteButton"),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import androidx.compose.runtime.saveable.rememberSaveable
|
|||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
@ -40,7 +41,8 @@ fun AttachmentItemContent(
|
|||
modifier = modifier
|
||||
.bottomDivider()
|
||||
.defaultMinSize(minHeight = 56.dp)
|
||||
.padding(vertical = 8.dp),
|
||||
.padding(vertical = 8.dp)
|
||||
.testTag("CipherAttachment"),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Text(
|
||||
|
@ -49,7 +51,8 @@ fun AttachmentItemContent(
|
|||
style = BitwardenTheme.typography.bodyMedium,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.weight(1f),
|
||||
modifier = Modifier.weight(1f)
|
||||
.testTag("AttachmentNameLabel"),
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
|
@ -58,7 +61,8 @@ fun AttachmentItemContent(
|
|||
text = attachmentItem.displaySize,
|
||||
color = BitwardenTheme.colorScheme.text.primary,
|
||||
style = BitwardenTheme.typography.labelSmall,
|
||||
modifier = Modifier,
|
||||
modifier = Modifier
|
||||
.testTag("AttachmentSizeLabel"),
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
|
@ -79,6 +83,8 @@ fun AttachmentItemContent(
|
|||
|
||||
onAttachmentDownloadClick(attachmentItem)
|
||||
},
|
||||
modifier = Modifier
|
||||
.testTag("AttachmentDownloadButton"),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -203,7 +203,6 @@ fun VaultItemLoginContent(
|
|||
items(attachments) { attachmentItem ->
|
||||
AttachmentItemContent(
|
||||
modifier = Modifier
|
||||
.testTag("CipherAttachment")
|
||||
.fillMaxWidth()
|
||||
.padding(start = 16.dp),
|
||||
attachmentItem = attachmentItem,
|
||||
|
|
Loading…
Add table
Reference in a new issue