aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/layout/copyright.test.tsx
blob: 1e2230c56edf69bd34fe1d98b6229ba40d1cee4b (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
import { describe, expect, it } from '@jest/globals';
import { render, screen } from '../../../../tests/utils';
import { CCBySA } from '../icons';
import { Copyright } from './copyright';

const dates = {
  start: '2012',
  end: '2022',
};
const icon = <CCBySA />;
const owner = 'Your name';

describe('Copyright', () => {
  it('renders the copyright owner', () => {
    render(<Copyright dates={dates} icon={icon} owner={owner} />);
    expect(screen.getByText(owner)).toBeInTheDocument();
  });

  it('renders the copyright start date', () => {
    render(<Copyright dates={dates} icon={icon} owner={owner} />);
    expect(screen.getByText(dates.start)).toBeInTheDocument();
  });

  it('renders the copyright end date', () => {
    render(<Copyright dates={dates} icon={icon} owner={owner} />);
    expect(screen.getByText(dates.end)).toBeInTheDocument();
  });

  it('renders the copyright icon', () => {
    render(<Copyright dates={dates} icon={icon} owner={owner} />);
    expect(screen.getByTitle('CC BY SA')).toBeInTheDocument();
  });
});