From 017d01680a933897df6ddd11d2e081730756250b Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 12 Apr 2022 16:55:59 +0200
Subject: chore: add a Footer component

---
 src/components/organisms/layout/footer.test.tsx | 33 +++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 src/components/organisms/layout/footer.test.tsx

(limited to 'src/components/organisms/layout/footer.test.tsx')

diff --git a/src/components/organisms/layout/footer.test.tsx b/src/components/organisms/layout/footer.test.tsx
new file mode 100644
index 0000000..bc23732
--- /dev/null
+++ b/src/components/organisms/layout/footer.test.tsx
@@ -0,0 +1,33 @@
+import { render, screen } from '@test-utils';
+import Footer, { type FooterProps } from './footer';
+
+const copyright: FooterProps['copyright'] = {
+  dates: { start: '2017', end: '2022' },
+  owner: 'Lorem ipsum',
+  icon: 'CC',
+};
+
+const navItems: FooterProps['navItems'] = [
+  { id: 'legal-notice', href: '#', label: 'Legal notice' },
+];
+
+describe('Footer', () => {
+  it('renders the website copyright', () => {
+    render(<Footer copyright={copyright} topId="top" />);
+    expect(screen.getByText(copyright.owner)).toBeInTheDocument();
+  });
+
+  it('renders a back to top link', () => {
+    render(<Footer copyright={copyright} topId="top" />);
+    expect(
+      screen.getByRole('link', { name: 'Back to top' })
+    ).toBeInTheDocument();
+  });
+
+  it('renders some nav items', () => {
+    render(<Footer copyright={copyright} navItems={navItems} topId="top" />);
+    expect(
+      screen.getByRole('link', { name: navItems[0].label })
+    ).toBeInTheDocument();
+  });
+});
-- 
cgit v1.2.3

