From 0c1d12c7f951db56e501145bd73071480273340a Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 5 Apr 2022 17:51:12 +0200
Subject: chore: add a SharingLink component

---
 src/components/atoms/links/sharing-link.test.tsx | 46 ++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 src/components/atoms/links/sharing-link.test.tsx

(limited to 'src/components/atoms/links/sharing-link.test.tsx')

diff --git a/src/components/atoms/links/sharing-link.test.tsx b/src/components/atoms/links/sharing-link.test.tsx
new file mode 100644
index 0000000..e4c849c
--- /dev/null
+++ b/src/components/atoms/links/sharing-link.test.tsx
@@ -0,0 +1,46 @@
+import { render, screen } from '@test-utils';
+import SharingLink from './sharing-link';
+
+describe('SharingLink', () => {
+  it('render a Diaspora sharing link', () => {
+    render(<SharingLink medium="diaspora" url="#" />);
+    expect(screen.getByRole('link', { name: 'Share on diaspora' })).toHaveClass(
+      'link--diaspora'
+    );
+  });
+
+  it('render an Email sharing link', () => {
+    render(<SharingLink medium="email" url="#" />);
+    expect(screen.getByRole('link', { name: 'Share on email' })).toHaveClass(
+      'link--email'
+    );
+  });
+
+  it('render a Facebook sharing link', () => {
+    render(<SharingLink medium="facebook" url="#" />);
+    expect(screen.getByRole('link', { name: 'Share on facebook' })).toHaveClass(
+      'link--facebook'
+    );
+  });
+
+  it('render a Journal du Hacker sharing link', () => {
+    render(<SharingLink medium="journal-du-hacker" url="#" />);
+    expect(
+      screen.getByRole('link', { name: 'Share on journal-du-hacker' })
+    ).toHaveClass('link--journal-du-hacker');
+  });
+
+  it('render a LinkedIn sharing link', () => {
+    render(<SharingLink medium="linkedin" url="#" />);
+    expect(screen.getByRole('link', { name: 'Share on linkedin' })).toHaveClass(
+      'link--linkedin'
+    );
+  });
+
+  it('render a Twitter sharing link', () => {
+    render(<SharingLink medium="twitter" url="#" />);
+    expect(screen.getByRole('link', { name: 'Share on twitter' })).toHaveClass(
+      'link--twitter'
+    );
+  });
+});
-- 
cgit v1.2.3

