]>
Commit | Line | Data |
---|---|---|
a7cf03c1 RBR |
1 | /** |
2 | * @jest-environment jsdom | |
3 | */ | |
4 | ||
879fa389 RBR |
5 | import '@testing-library/jest-dom/extend-expect'; |
6 | ||
7 | import { render } from '@testing-library/svelte'; | |
a7cf03c1 | 8 | import '$lib/i18n'; |
879fa389 RBR |
9 | |
10 | import ErrorBlock from './error_block.svelte'; | |
11 | ||
47b0bfe4 | 12 | describe('Error Block component', () => { |
879fa389 | 13 | |
8ae7249a | 14 | test('Should display error message sent', () => { |
879fa389 RBR |
15 | |
16 | const results = render(ErrorBlock, { props: { | |
17 | message: 'An error has, sadly, destroyed everything.' | |
18 | } }); | |
19 | ||
20 | expect(results.getByText('An error has, sadly, destroyed everything.')) | |
21 | .toBeVisible(); | |
22 | }); | |
8ae7249a RBR |
23 | |
24 | test('Should display default error message', () => { | |
25 | ||
26 | const results = render(ErrorBlock); | |
27 | ||
28 | expect(results.getByText('Unknown error has occurred. Panic!')) | |
29 | .toBeVisible(); | |
30 | }); | |
879fa389 RBR |
31 | }); |
32 |