diff options
Diffstat (limited to 'src/components/organisms/widgets/sharing.test.tsx')
| -rw-r--r-- | src/components/organisms/widgets/sharing.test.tsx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/components/organisms/widgets/sharing.test.tsx b/src/components/organisms/widgets/sharing.test.tsx new file mode 100644 index 0000000..48da49e --- /dev/null +++ b/src/components/organisms/widgets/sharing.test.tsx @@ -0,0 +1,23 @@ +import { render, screen } from '@test-utils'; +import Sharing, { type SharingData } from './sharing'; + +const postData: SharingData = { + excerpt: 'A post excerpt', + title: 'A post title', + url: 'https://sharing-website.test', +}; + +describe('Sharing', () => { + it('renders a sharing widget', () => { + render(<Sharing data={postData} media={['facebook', 'twitter']} />); + expect( + screen.getByRole('link', { name: 'Share on facebook' }) + ).toBeInTheDocument(); + expect( + screen.getByRole('link', { name: 'Share on twitter' }) + ).toBeInTheDocument(); + expect( + screen.queryByRole('link', { name: 'Share on linkedin' }) + ).not.toBeInTheDocument(); + }); +}); |
