From 5d3e8a4d0c2ce2ad8f22df857ab3ce54fcfc38ac Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 3 Nov 2023 12:22:47 +0100
Subject: refactor(components): replace Toolbar with Navbar component

* remove SearchModal and SettingsModal components
* add a generic NavbarItem component (instead of the previous toolbar
items to avoid unreadable styles...)
* move FlippingLabel component logic into NavbarItem since it is only
used here
---
 src/components/organisms/toolbar/main-nav.test.tsx | 45 ----------------------
 1 file changed, 45 deletions(-)
 delete mode 100644 src/components/organisms/toolbar/main-nav.test.tsx

(limited to 'src/components/organisms/toolbar/main-nav.test.tsx')

diff --git a/src/components/organisms/toolbar/main-nav.test.tsx b/src/components/organisms/toolbar/main-nav.test.tsx
deleted file mode 100644
index 177e692..0000000
--- a/src/components/organisms/toolbar/main-nav.test.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { describe, expect, it } from '@jest/globals';
-import { render, screen as rtlScreen } from '../../../../tests/utils';
-import { MainNavItem } from './main-nav';
-
-const doNothing = () => {
-  // do nothing
-};
-
-const items = [
-  { id: 'home', label: 'Home', href: '/' },
-  { id: 'blog', label: 'Blog', href: '/blog' },
-  { id: 'contact', label: 'Contact', href: '/contact' },
-];
-
-describe('MainNavItem', () => {
-  it('renders a checkbox to open main nav', () => {
-    render(
-      <MainNavItem items={items} isActive={false} setIsActive={doNothing} />
-    );
-    expect(rtlScreen.getByRole('checkbox')).toHaveAccessibleName('Open menu');
-  });
-
-  it('renders a checkbox to close main nav', () => {
-    render(
-      <MainNavItem items={items} isActive={true} setIsActive={doNothing} />
-    );
-    expect(rtlScreen.getByRole('checkbox')).toHaveAccessibleName('Close menu');
-  });
-
-  it('renders the correct number of items', () => {
-    render(
-      <MainNavItem items={items} isActive={true} setIsActive={doNothing} />
-    );
-    expect(rtlScreen.getAllByRole('listitem')).toHaveLength(items.length);
-  });
-
-  it('renders some links with the right label', () => {
-    render(
-      <MainNavItem items={items} isActive={true} setIsActive={doNothing} />
-    );
-    expect(
-      rtlScreen.getByRole('link', { name: items[0].label })
-    ).toHaveAttribute('href', items[0].href);
-  });
-});
-- 
cgit v1.2.3

