aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/layout/meta.test.tsx
blob: e01a0a1faa3a6741a24b8dda2f6beef7ade511e9 (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
import { render, screen } from '@tests/utils';
import { getFormattedDate } from '@utils/helpers/dates';
import Meta from './meta';

const data = {
  publication: { date: '2022-04-09' },
  thematics: [
    <a key="category1" href="#">
      Category 1
    </a>,
    <a key="category2" href="#">
      Category 2
    </a>,
  ],
};

describe('Meta', () => {
  it('format a date string', () => {
    render(<Meta data={data} />);
    expect(
      screen.getByText(getFormattedDate(data.publication.date))
    ).toBeInTheDocument();
  });
});