aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/nav/main-nav/main-nav.test.tsx
blob: 86c1eb587b6280d1b1556e9a2ce0b0acaef29f49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { describe, expect, it } from '@jest/globals';
import { render, screen as rtlScreen } from '@testing-library/react';
import { MainNav } from './main-nav';

const items = [
  { id: 'home', label: 'Home', href: '#home' },
  { id: 'blog', label: 'Blog', href: '#blog' },
  { id: 'projects', label: 'Projects', href: '#projects' },
  { id: 'contact', label: 'Contact', href: '#contact' },
];

describe('MainNav', () => {
  it('renders a list of nav items', () => {
    render(<MainNav items={items} />);

    expect(rtlScreen.getAllByRole('link')).toHaveLength(items.length);
  });
});