From d17d894f398650209c0ddd29502308de8c07bd93 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Wed, 27 Sep 2023 18:43:25 +0200
Subject: feat(components): add Article, Aside, Footer, Header, Main & Nav

Some components have been renamed to be able to create Footer, Header
and Nav.
---
 src/components/molecules/nav/nav-list.test.tsx | 28 ++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 src/components/molecules/nav/nav-list.test.tsx

(limited to 'src/components/molecules/nav/nav-list.test.tsx')

diff --git a/src/components/molecules/nav/nav-list.test.tsx b/src/components/molecules/nav/nav-list.test.tsx
new file mode 100644
index 0000000..58437cb
--- /dev/null
+++ b/src/components/molecules/nav/nav-list.test.tsx
@@ -0,0 +1,28 @@
+import { describe, expect, it } from '@jest/globals';
+import { render, screen as rtlScreen } from '../../../../tests/utils';
+import { Envelop, Home } from '../../atoms';
+import { NavList, type NavItem } from './nav-list';
+
+const navItems: NavItem[] = [
+  { id: 'homeLink', href: '/', label: 'Home', logo: <Home /> },
+  { id: 'contactLink', href: '/contact', label: 'Contact', logo: <Envelop /> },
+];
+
+describe('Nav', () => {
+  it('renders a main navigation', () => {
+    render(<NavList kind="main" items={navItems} />);
+    expect(rtlScreen.getByRole('navigation')).toHaveClass('nav--main');
+  });
+
+  it('renders a footer navigation', () => {
+    render(<NavList kind="footer" items={navItems} />);
+    expect(rtlScreen.getByRole('navigation')).toHaveClass('nav--footer');
+  });
+
+  it('renders navigation links', () => {
+    render(<NavList kind="main" items={navItems} />);
+    expect(
+      rtlScreen.getByRole('link', { name: navItems[0].label })
+    ).toHaveAttribute('href', navItems[0].href);
+  });
+});
-- 
cgit v1.2.3

