From a07729064790df13324dbe7f4d1629892070558b Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 15 Apr 2022 17:13:21 +0200
Subject: chore: add a SharingWidget component

---
 src/components/organisms/widgets/sharing.test.tsx | 31 +++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 src/components/organisms/widgets/sharing.test.tsx

(limited to 'src/components/organisms/widgets/sharing.test.tsx')

diff --git a/src/components/organisms/widgets/sharing.test.tsx b/src/components/organisms/widgets/sharing.test.tsx
new file mode 100644
index 0000000..265dbe1
--- /dev/null
+++ b/src/components/organisms/widgets/sharing.test.tsx
@@ -0,0 +1,31 @@
+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']}
+        expanded={true}
+        title="Sharing"
+        level={2}
+      />
+    );
+    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();
+  });
+});
-- 
cgit v1.2.3

