aboutsummaryrefslogtreecommitdiff
path: root/src/lib/components/actions/topic.test.ts
blob: 9a17d3823288481b0f7aa8c2828bc79c6a0c79b6 (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
26
27
/**
 * @jest-environment jsdom
 */

import '@testing-library/jest-dom/extend-expect';

import { render } from '@testing-library/svelte';
import '$lib/i18n';

import Topic from './topic.svelte';

describe('Topic Actions component', () => {
	test('Should link to reply page', () => {
		const results = render(Topic, {
			props: {
				actions: {
					id: '8ebaa211-fd9b-423a-8b4f-b57622007fde'
				}
			}
		});

		expect(results.getByTitle('Reply').closest('a')).toHaveAttribute(
			'href',
			'/reply/8ebaa211-fd9b-423a-8b4f-b57622007fde'
		);
	});
});