aboutsummaryrefslogtreecommitdiff
path: root/src/components/error_block
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2021-04-22 00:18:28 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2021-04-22 00:18:28 +0200
commit8ae7249a5bb12f23d402f0ede32956827de4e111 (patch)
tree3ddd11865c18748d3856208b0063b3067707868d /src/components/error_block
parent47b0bfe47e6f13d549897149b0abc4a72ba8ac88 (diff)
Add blink test + coverage improvements
Diffstat (limited to 'src/components/error_block')
-rw-r--r--src/components/error_block/error_block.svelte2
-rw-r--r--src/components/error_block/error_block.test.js10
2 files changed, 10 insertions, 2 deletions
diff --git a/src/components/error_block/error_block.svelte b/src/components/error_block/error_block.svelte
index 3a43a1e..e38bfae 100644
--- a/src/components/error_block/error_block.svelte
+++ b/src/components/error_block/error_block.svelte
@@ -1,6 +1,6 @@
<script>
import { _ } from 'svelte-i18n';
- export let message;
+ export let message = null;
import { blink } from '$/animations/blink';
</script>
diff --git a/src/components/error_block/error_block.test.js b/src/components/error_block/error_block.test.js
index 1d7a7ac..43c9331 100644
--- a/src/components/error_block/error_block.test.js
+++ b/src/components/error_block/error_block.test.js
@@ -7,7 +7,7 @@ import ErrorBlock from './error_block.svelte';
describe('Error Block component', () => {
- test('Should act as an image', () => {
+ test('Should display error message sent', () => {
const results = render(ErrorBlock, { props: {
message: 'An error has, sadly, destroyed everything.'
@@ -16,5 +16,13 @@ describe('Error Block component', () => {
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();
+ });
});