blob: 053047882259defe3042b692a4f5973e3d4fb7e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import { describe, expect, it } from '@jest/globals';
import { render, screen as rtlScreen } from '../../../../tests/utils';
import { Copyright } from './copyright';
const from = '2012';
const to = '2023';
const owner = 'Your name';
describe('Copyright', () => {
it('renders the copyright symbol, the owner and the start year', () => {
render(<Copyright from={from} owner={owner} />);
expect(rtlScreen.getByText(new RegExp(owner))).toBeInTheDocument();
expect(rtlScreen.getByText(from)).toBeInTheDocument();
});
it('can render a copyright with end year', () => {
render(<Copyright from={from} owner={owner} to={to} />);
expect(rtlScreen.getByText(from)).toBeInTheDocument();
expect(rtlScreen.getByText(to)).toBeInTheDocument();
});
});
|