diff options
Diffstat (limited to 'src/components/molecules/layout/meta.test.tsx')
| -rw-r--r-- | src/components/molecules/layout/meta.test.tsx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/components/molecules/layout/meta.test.tsx b/src/components/molecules/layout/meta.test.tsx new file mode 100644 index 0000000..fe66d97 --- /dev/null +++ b/src/components/molecules/layout/meta.test.tsx @@ -0,0 +1,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(); + }); +}); |
