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', () => {
13 test('Should display error message sent', () => {
14 const results = render(ErrorBlock, {
16 message: 'An error has, sadly, destroyed everything.'
20 expect(results.getByText('An error has, sadly, destroyed everything.')).toBeVisible();
23 test('Should display default error message', () => {
24 const results = render(ErrorBlock);
26 expect(results.getByText('Unknown error has occurred. Panic!')).toBeVisible();