From e331106e56d59a8b987230860b66214139c12ef6 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 13 Nov 2023 18:46:31 +0100 Subject: refactor(components): rewrite ImageWidget component * remove `imageClassName` prop * replace `image` prop with `img` and expect an image instead of an object * remove `alignment prop` * remove useless CSS --- .../organisms/widgets/image-widget.test.tsx | 55 ---------------------- 1 file changed, 55 deletions(-) delete mode 100644 src/components/organisms/widgets/image-widget.test.tsx (limited to 'src/components/organisms/widgets/image-widget.test.tsx') diff --git a/src/components/organisms/widgets/image-widget.test.tsx b/src/components/organisms/widgets/image-widget.test.tsx deleted file mode 100644 index 3d48947..0000000 --- a/src/components/organisms/widgets/image-widget.test.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import { describe, expect, it } from '@jest/globals'; -import { render, screen as rtlScreen } from '@testing-library/react'; -import { Heading } from '../../atoms'; -import { ImageWidget } from './image-widget'; - -const description = 'Ut vitae sit'; - -const img = { - alt: 'Et perferendis quaerat', - height: 480, - src: 'http://placeimg.com/640/480/nature', - width: 640, -}; - -const title = 'Fugiat cumque et'; -const titleLevel = 2; - -const url = '/another-page'; - -describe('ImageWidget', () => { - it('renders an image', () => { - render( - {title}} - image={img} - /> - ); - expect(rtlScreen.getByRole('img', { name: img.alt })).toBeInTheDocument(); - }); - - it('renders an image with a link', () => { - render( - {title}} - image={img} - url={url} - /> - ); - expect(rtlScreen.getByRole('link', { name: img.alt })).toHaveAttribute( - 'href', - url - ); - }); - - it('renders a description', () => { - render( - {title}} - image={img} - description={description} - /> - ); - expect(rtlScreen.getByText(description)).toBeInTheDocument(); - }); -}); -- cgit v1.2.3