import { render as rTLRender } from '@testing-library/react'; import previewIcon from 'assets/uploadIcon.svg'; import UploadedItem from '../components/UploadedItem'; import BaseApp from '../../BaseApp'; const defaultProps = { fileName: 'Testing.png', filePreview: previewIcon, }; const variant = ['uploading', 'disabled', 'enabled', 'irremovable'] as const; describe('UploadedItem', () => { describe('Snapshots', () => { it('should upload preview and fileName', () => { const wrapper = rTLRender(); expect(wrapper).toMatchSnapshot(); }); it('should render with RTL theme - upload preview and fileName', () => { const wrapper = rTLRender( ); expect(wrapper).toMatchSnapshot(); }); it('should upload preview only', () => { const wrapper = rTLRender( ); expect(wrapper).toMatchSnapshot(); }); it('should render with RTL theme - preview only', () => { const wrapper = rTLRender( ); expect(wrapper).toMatchSnapshot(); }); it('should upload preview only in larger size', () => { const wrapper = rTLRender( ); expect(wrapper).toMatchSnapshot(); }); it('should upload fileName only', () => { const wrapper = rTLRender( ); expect(wrapper).toMatchSnapshot(); }); variant.forEach(value => { it(`UploadedItem-${value}`, () => { const wrapper = rTLRender( ); expect(wrapper).toMatchSnapshot(); }); }); }); });