]>
git.r.bdr.sh - rbdr/forum/blob - src/components/header/header.test.js
1 import '@testing-library/jest-dom/extend-expect';
3 import { render
} from '@testing-library/svelte';
4 import '$/config/i18n';
5 import { enableTopicActions
} from '$/stores/actions';
7 jest
.mock('$/config/config.js');
9 import Header
from './header.svelte';
11 describe('Header component', () => {
13 test('Should not display topic if action is not set', () => {
15 const results
= render(Header
);
17 expect(results
.queryByTitle('Reply'))
21 test('Should display topic if action is set', () => {
23 enableTopicActions('d138d6d8-e669-42e7-995d-20a7fcc176f5');
24 const results
= render(Header
);
26 expect(results
.getByTitle('Reply'))