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