aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/layout/meta.test.tsx
blob: fe66d97118090dcc7a00d252b4df30dd9b2718a2 (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 '@test-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();
  });
});