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