aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout/header.test.tsx
blob: 1ef79e055ab1dac3a21012e524b0750d6d735c58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { render, screen } from '@tests/utils';
import Header from './header';

const nav = [
  { id: 'home-link', href: '#', label: 'Home' },
  { id: 'blog-link', href: '#', label: 'Blog' },
  { id: 'cv-link', href: '#', label: 'CV' },
  { id: 'contact-link', href: '#', label: 'Contact' },
];

const photo = 'http://placeimg.com/640/480/nightlife';

const title = 'Assumenda quis quod';

describe('Header', () => {
  it('renders the website title', () => {
    render(
      <Header
        ackeeStorageKey="ackee-tracking"
        isHome={true}
        motionStorageKey="reduced-motion"
        nav={nav}
        photo={photo}
        searchPage="#"
        title={title}
      />
    );
    expect(
      screen.getByRole('heading', { level: 1, name: title })
    ).toBeInTheDocument();
  });

  it('renders the main nav', () => {
    render(
      <Header
        ackeeStorageKey="ackee-tracking"
        motionStorageKey="reduced-motion"
        nav={nav}
        photo={photo}
        searchPage="#"
        title={title}
      />
    );
    expect(screen.getByRole('navigation')).toBeInTheDocument();
  });
});