diff --git a/packages/dnb-eufemia/src/components/upload/UploadFileListCell.tsx b/packages/dnb-eufemia/src/components/upload/UploadFileListCell.tsx index 5c6f00caf4b..fb88a1d65ac 100644 --- a/packages/dnb-eufemia/src/components/upload/UploadFileListCell.tsx +++ b/packages/dnb-eufemia/src/components/upload/UploadFileListCell.tsx @@ -66,7 +66,7 @@ const UploadFileListCell = ({ const { file, errorMessage, isLoading } = uploadFile const { name, type } = file - const fileType = type.split('/')[1] + const fileType = type.split('/')[1] || '' const hasWarning = errorMessage != null diff --git a/packages/dnb-eufemia/src/components/upload/__tests__/UploadFileListCell.test.tsx b/packages/dnb-eufemia/src/components/upload/__tests__/UploadFileListCell.test.tsx index 8a6c43c3dc5..0e68e9273aa 100644 --- a/packages/dnb-eufemia/src/components/upload/__tests__/UploadFileListCell.test.tsx +++ b/packages/dnb-eufemia/src/components/upload/__tests__/UploadFileListCell.test.tsx @@ -40,6 +40,19 @@ describe('UploadFileListCell', () => { expect(element.className).toMatch('dnb-upload__file-cell--warning') }) + it('supports special file extensions', async () => { + render( + + ) + + const element = document.querySelector('.dnb-upload__file-cell__title') + + expect(element.textContent).toMatch('file.dat') + }) + it('renders the no error styling', () => { render(