]>
git.r.bdr.sh - rbdr/forum/blob - src/components/tag/tag.test.js
3f19598b4a3eb0a92fb27285f656e04f8c08ffa7
1 import '@testing-library/jest-dom/extend-expect';
3 import { render
} from '@testing-library/svelte';
4 import '$/config/i18n';
6 import Tag
from './tag.svelte';
12 describe('Tag component', () => {
16 internals
.results
= render(Tag
, { props: {
21 id: 'eb751e7a-5777-46c3-b81b-cc66546d5157',
22 title: 'A single topic',
24 updated_at: Date
.now()
27 id: 'b4a5613c-237b-4147-a867-9c105d51e365',
28 title: 'And its companion',
30 updated_at: Date
.now()
37 test('It should display the tag title', () => {
39 expect(internals
.results
.getByText('Tag: avocado'))
43 test('It should display the topics', () => {
45 expect(internals
.results
.getByText('A single topic'))
47 expect(internals
.results
.getByText('And its companion'))