]> git.r.bdr.sh - rbdr/forum/blame_incremental - src/lib/components/header/header.test.ts
Lint, rm unused code
[rbdr/forum] / src / lib / components / header / header.test.ts
... / ...
CommitLineData
1/**
2 * @jest-environment jsdom
3 */
4
5import '@testing-library/jest-dom/extend-expect';
6
7import { render } from '@testing-library/svelte';
8import '$lib/i18n';
9import { enableTopicActions } from '$lib/stores/actions';
10
11jest.mock('$lib/config/config.ts');
12
13import Header from './header.svelte';
14
15describe('Header component', () => {
16 test('Should not display topic if action is not set', () => {
17 const results = render(Header);
18
19 expect(results.queryByTitle('Reply')).toBe(null);
20 });
21
22 test('Should display topic if action is set', () => {
23 enableTopicActions('d138d6d8-e669-42e7-995d-20a7fcc176f5');
24 const results = render(Header);
25
26 expect(results.getByTitle('Reply')).toBeVisible();
27 });
28});