From c6f6f8f895e68f2d85ca681997ef613d982bac14 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 20 Oct 2023 14:06:48 +0200
Subject: refactor(components): rewrite NavList component

* extract NavItem from NavList
* remove `kind` and `listClassName` props (since the consumer has
control over NavList, NavItem and NavLink components these props are
obsolete)
---
 .../molecules/nav/nav-item/nav-item.test.tsx       | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 src/components/molecules/nav/nav-item/nav-item.test.tsx

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

diff --git a/src/components/molecules/nav/nav-item/nav-item.test.tsx b/src/components/molecules/nav/nav-item/nav-item.test.tsx
new file mode 100644
index 0000000..a78b97b
--- /dev/null
+++ b/src/components/molecules/nav/nav-item/nav-item.test.tsx
@@ -0,0 +1,25 @@
+import { describe, expect, it } from '@jest/globals';
+import { render, screen as rtlScreen } from '@testing-library/react';
+import { NavLink } from '../nav-link';
+import { NavItem } from './nav-item';
+
+describe('NavItem', () => {
+  it('renders its children', () => {
+    const label = 'maxime';
+    const target = '#sunt';
+
+    render(
+      <ul>
+        <NavItem>
+          <NavLink href={target} label={label} />
+        </NavItem>
+      </ul>
+    );
+
+    expect(rtlScreen.getByRole('listitem')).toHaveTextContent(label);
+    expect(rtlScreen.getByRole('link', { name: label })).toHaveAttribute(
+      'href',
+      target
+    );
+  });
+});
-- 
cgit v1.2.3

