]>
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', () => { |
cac85db0 RBR |
13 | test('Should display error message sent', () => { |
14 | const results = render(ErrorBlock, { | |
15 | props: { | |
16 | message: 'An error has, sadly, destroyed everything.' | |
17 | } | |
18 | }); | |
879fa389 | 19 | |
cac85db0 RBR |
20 | expect(results.getByText('An error has, sadly, destroyed everything.')).toBeVisible(); |
21 | }); | |
879fa389 | 22 | |
cac85db0 RBR |
23 | test('Should display default error message', () => { |
24 | const results = render(ErrorBlock); | |
879fa389 | 25 | |
cac85db0 RBR |
26 | expect(results.getByText('Unknown error has occurred. Panic!')).toBeVisible(); |
27 | }); | |
879fa389 | 28 | }); |