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