]> git.r.bdr.sh - rbdr/forum/blame - src/components/header/header.test.js
Add posts store pact test
[rbdr/forum] / src / components / header / header.test.js
CommitLineData
55fb920b
RBR
1import '@testing-library/jest-dom/extend-expect';
2
3import { render } from '@testing-library/svelte';
4import '$/config/i18n';
5import { enableTopicActions } from '$/stores/actions';
6
73973eda
RBR
7jest.mock('$/config/config.js');
8
55fb920b
RBR
9import Header from './header.svelte';
10
11describe('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});