Name the file in the remove button's failure description

The remove button's label is "Remove attachment" and doesn't say which
file. Its failure description now reads "<file>: <reason>", the same text
as the tooltip.
This commit is contained in:
arc53-machine committed 2026-09-28 10:47:30 +01:00
1 parent 7e990d4384
commit 3a156ff21d
2 files changed
+3 -2

No files matched your search

@@ -106,8 +106,9 @@ describe('AttachmentChipList failed chip', () => {
)!;
const describedBy = remove.getAttribute('aria-describedby');
expect(describedBy).toBeTruthy();
// Named, since the button's own label doesn't say which file.
expect(document.getElementById(describedBy!)?.textContent).toBe(
'Upload failed. The file could not be read.',
'scan.pdf: Upload failed. The file could not be read.',
);
});
@@ -124,7 +124,7 @@ export default function AttachmentChipList({
</span>
{failureReason && (
<span id={reasonId} hidden>
{failureReason}
{attachment.fileName}: {failureReason}
</span>
)}