blob: f19c408b02ea98100e7aa6104b65334c0d590edd (
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
|
import { describe, expect, it } from '@jest/globals';
import { render, screen } from '../../../../tests/utils';
import { getFormattedDate } from '../../../utils/helpers';
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();
});
});
|