Skip to content

Commit

Permalink
QA-951: Adding missing IDs for Attachment rows (#4148)
Browse files Browse the repository at this point in the history
  • Loading branch information
ifernandezdiaz authored Oct 24, 2024
1 parent b0885ff commit 0ff2fe6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ fun AttachmentsContent(
onDeleteClick = attachmentsHandlers.onDeleteClick,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
.padding(horizontal = 16.dp)
.testTag("AttachmentList"),
)
}
}
Expand All @@ -92,7 +93,8 @@ fun AttachmentsContent(
textAlign = TextAlign.Center,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
.padding(horizontal = 16.dp)
.testTag("SelectedFileNameLabel"),
)
}

Expand All @@ -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(
Expand Down Expand Up @@ -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))
Expand All @@ -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))
Expand All @@ -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"),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -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))
Expand All @@ -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))
Expand All @@ -79,6 +83,8 @@ fun AttachmentItemContent(

onAttachmentDownloadClick(attachmentItem)
},
modifier = Modifier
.testTag("AttachmentDownloadButton"),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ fun VaultItemLoginContent(
items(attachments) { attachmentItem ->
AttachmentItemContent(
modifier = Modifier
.testTag("CipherAttachment")
.fillMaxWidth()
.padding(start = 16.dp),
attachmentItem = attachmentItem,
Expand Down

0 comments on commit 0ff2fe6

Please sign in to comment.