]>
git.r.bdr.sh - rbdr/forum/blob - src/components/error_block/error_block.test.js
1 import '@testing-library/jest-dom/extend-expect';
3 import { render
} from '@testing-library/svelte';
4 import '$/config/i18n';
6 import ErrorBlock
from './error_block.svelte';
8 describe('Error Block component', () => {
10 test('Should display error message sent', () => {
12 const results
= render(ErrorBlock
, { props: {
13 message: 'An error has, sadly, destroyed everything.'
16 expect(results
.getByText('An error has, sadly, destroyed everything.'))
20 test('Should display default error message', () => {
22 const results
= render(ErrorBlock
);
24 expect(results
.getByText('Unknown error has occurred. Panic!'))