blob: 43c9331a75f461c0ab7b58f38f78535d3085c00c (
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
|
import '@testing-library/jest-dom/extend-expect';
import { render } from '@testing-library/svelte';
import '$/config/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();
});
});
|