]> git.r.bdr.sh - rbdr/forum/blame_incremental - src/lib/components/error_block/error_block.test.ts
Don't remember what this WIP was about
[rbdr/forum] / src / lib / components / error_block / error_block.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';
9
10import ErrorBlock from './error_block.svelte';
11
12describe('Error Block component', () => {
13 test('Should display error message sent', () => {
14 const results = render(ErrorBlock, {
15 props: {
16 message: 'An error has, sadly, destroyed everything.'
17 }
18 });
19
20 expect(results.getByText('An error has, sadly, destroyed everything.')).toBeVisible();
21 });
22
23 test('Should display default error message', () => {
24 const results = render(ErrorBlock);
25
26 expect(results.getByText('Unknown error has occurred. Panic!')).toBeVisible();
27 });
28});