diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-11-13 19:03:44 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-13 19:03:44 +0100 |
| commit | fb29b0f017fae162ffa7ad6bdfc80099346802de (patch) | |
| tree | 3f8aebb73457ee27b86b8b1a3106a5f9bc35e8da /src/components/organisms/widgets/social-media.test.tsx | |
| parent | e331106e56d59a8b987230860b66214139c12ef6 (diff) | |
refactor(components): replace SocialMedia with SocialMediaWidget
* the goal is to make the name of the widgets coherent
* remove useless CSS
* replace Media type with SocialMediaData
Diffstat (limited to 'src/components/organisms/widgets/social-media.test.tsx')
| -rw-r--r-- | src/components/organisms/widgets/social-media.test.tsx | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/components/organisms/widgets/social-media.test.tsx b/src/components/organisms/widgets/social-media.test.tsx deleted file mode 100644 index ead29d9..0000000 --- a/src/components/organisms/widgets/social-media.test.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { describe, expect, it } from '@jest/globals'; -import { render, screen as rtlScreen } from '../../../../tests/utils'; -import { SocialMedia, type Media } from './social-media'; -import { Heading } from 'src/components/atoms'; - -const media: Media[] = [ - { icon: 'Github', id: 'github', label: 'Github', url: '#' }, - { icon: 'LinkedIn', id: 'gitlab', label: 'Gitlab', url: '#' }, -]; -const title = 'Dolores ut ut'; -const titleLevel = 2; - -/** - * Next.js mock images with next/image component. So for now, I need to mock - * the svg files manually. - */ -jest.mock('@assets/images/social-media/github.svg', () => 'svg-file'); -jest.mock('@assets/images/social-media/gitlab.svg', () => 'svg-file'); -jest.mock('@assets/images/social-media/linkedin.svg', () => 'svg-file'); -jest.mock('@assets/images/social-media/twitter.svg', () => 'svg-file'); - -describe('SocialMedia', () => { - it('renders the widget title', () => { - render( - <SocialMedia - heading={<Heading level={titleLevel}>{title}</Heading>} - media={media} - /> - ); - expect( - rtlScreen.getByRole('heading', { - level: titleLevel, - name: new RegExp(title, 'i'), - }) - ).toBeInTheDocument(); - }); - - it('renders the correct number of items', () => { - render( - <SocialMedia - heading={<Heading level={titleLevel}>{title}</Heading>} - media={media} - /> - ); - expect(rtlScreen.getAllByRole('listitem')).toHaveLength(media.length); - }); -}); |
