diff --git a/packages/dnb-eufemia/src/components/upload/UploadFileListCell.tsx b/packages/dnb-eufemia/src/components/upload/UploadFileListCell.tsx index 0649fa26e92..999c92b0afe 100644 --- a/packages/dnb-eufemia/src/components/upload/UploadFileListCell.tsx +++ b/packages/dnb-eufemia/src/components/upload/UploadFileListCell.tsx @@ -6,7 +6,6 @@ import Button from '../button/Button' import Icon from '../../components/Icon' import FormStatus from '../../components/FormStatus' import ProgressIndicator from '../../components/progress-indicator' -import P from '../../elements/P' // Icons import { @@ -68,7 +67,6 @@ const UploadFileListCell = ({ const hasWarning = errorMessage != null const fileType = getFileTypeFromExtension(file) - const humanFileType = fileType.toUpperCase() const imageUrl = URL.createObjectURL(file) const cellRef = useRef() @@ -169,13 +167,6 @@ const UploadFileListCell = ({ > {file.name} -

- {humanFileType} -

) } 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 3da15c7c38b..c62adcffdf7 100644 --- a/packages/dnb-eufemia/src/components/upload/__tests__/UploadFileListCell.test.tsx +++ b/packages/dnb-eufemia/src/components/upload/__tests__/UploadFileListCell.test.tsx @@ -4,8 +4,6 @@ import UploadFileListCell, { import { createMockFile } from './testHelpers' import { render, screen } from '@testing-library/react' import React from 'react' -import { UploadContext } from '../UploadContext' -import { UploadContextProps } from '../types' global.URL.createObjectURL = jest.fn(() => 'url') @@ -17,20 +15,6 @@ const defaultProps: UploadFileListCellProps = { loadingText: 'loading', } -const makeWrapper = (props = null) => { - const defaultContext: UploadContextProps = { - ...defaultProps, - ...props, - } - return ({ children }) => { - return ( - - {children} - - ) - } -} - describe('UploadFileListCell', () => { it('renders the component', () => { render() @@ -83,56 +67,6 @@ describe('UploadFileListCell', () => { expect(element.className).toMatch('dnb-upload__file-cell') }) - it('renders the subtitle and uses the file mime', () => { - render( - - ) - - expect(screen.queryByText('PNG')).toBeInTheDocument() - }) - - it('renders the subtitle and uses the extension if mime is missing', () => { - render( - - ) - - expect(screen.queryByText('PNG')).toBeInTheDocument() - }) - - it('renders the subtitle with file extension when set by acceptedFileTypes', () => { - render( - , - { - wrapper: makeWrapper({ acceptedFileTypes: ['png'] }), - } - ) - - expect(screen.queryByText('PNG')).toBeInTheDocument() - }) - - it('renders the subtitle with file mime when set by acceptedFileTypes', () => { - render( - , - { - wrapper: makeWrapper({ acceptedFileTypes: ['image/png'] }), - } - ) - - expect(screen.queryByText('PNG')).toBeInTheDocument() - }) - it('renders the form errorMessage warning', () => { const errorMessage = 'error message' diff --git a/packages/dnb-eufemia/src/components/upload/__tests__/__image_snapshots__/upload-for-sbanken-have-to-match-file-list.snap.png b/packages/dnb-eufemia/src/components/upload/__tests__/__image_snapshots__/upload-for-sbanken-have-to-match-file-list.snap.png index 1cf33c96cfa..bb5879284d6 100644 Binary files a/packages/dnb-eufemia/src/components/upload/__tests__/__image_snapshots__/upload-for-sbanken-have-to-match-file-list.snap.png and b/packages/dnb-eufemia/src/components/upload/__tests__/__image_snapshots__/upload-for-sbanken-have-to-match-file-list.snap.png differ diff --git a/packages/dnb-eufemia/src/components/upload/__tests__/__image_snapshots__/upload-for-ui-have-to-match-file-list.snap.png b/packages/dnb-eufemia/src/components/upload/__tests__/__image_snapshots__/upload-for-ui-have-to-match-file-list.snap.png index e79aaf51e0b..209d3d31ea4 100644 Binary files a/packages/dnb-eufemia/src/components/upload/__tests__/__image_snapshots__/upload-for-ui-have-to-match-file-list.snap.png and b/packages/dnb-eufemia/src/components/upload/__tests__/__image_snapshots__/upload-for-ui-have-to-match-file-list.snap.png differ