2 * @jest-environment jsdom
5 import '@testing-library/jest-dom/extend-expect';
7 import { render } from '@testing-library/svelte';
10 import ErrorBlock from './error_block.svelte';
12 describe('Error Block component', () => {
14 test('Should display error message sent', () => {
16 const results = render(ErrorBlock, { props: {
17 message: 'An error has, sadly, destroyed everything.'
20 expect(results.getByText('An error has, sadly, destroyed everything.'))
24 test('Should display default error message', () => {
26 const results = render(ErrorBlock);
28 expect(results.getByText('Unknown error has occurred. Panic!'))