From daaa789068cebb5fdfcea6197ade6e663be46e0f Mon Sep 17 00:00:00 2001 From: Bobby Date: Wed, 30 Nov 2022 23:16:07 -0500 Subject: socialify update --- .../error/__snapshots__/error.test.tsx.snap | 46 ++++++++++++++++++++++ src/components/error/error.test.tsx | 16 ++++++++ src/components/error/error.tsx | 30 ++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 src/components/error/__snapshots__/error.test.tsx.snap create mode 100644 src/components/error/error.test.tsx create mode 100644 src/components/error/error.tsx (limited to 'src/components/error') diff --git a/src/components/error/__snapshots__/error.test.tsx.snap b/src/components/error/__snapshots__/error.test.tsx.snap new file mode 100644 index 0000000..9e1289e --- /dev/null +++ b/src/components/error/__snapshots__/error.test.tsx.snap @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Error renders 1`] = ` +
+
+
+

+ 404 +

+

+ Page not found. +

+

+ Sorry, we couldn't find the page you're looking for. +

+ +
+
+
+`; diff --git a/src/components/error/error.test.tsx b/src/components/error/error.test.tsx new file mode 100644 index 0000000..9cd67f9 --- /dev/null +++ b/src/components/error/error.test.tsx @@ -0,0 +1,16 @@ +import { render } from '@testing-library/react' + +import Error from './error' + +test('Error renders', () => { + const { container } = render( + + ) + const error = container.firstElementChild! + + expect(error).toMatchSnapshot() +}) diff --git a/src/components/error/error.tsx b/src/components/error/error.tsx new file mode 100644 index 0000000..8a002f7 --- /dev/null +++ b/src/components/error/error.tsx @@ -0,0 +1,30 @@ +import React from 'react' +import Link from 'next/link' + +type ErrorProp = { + code: string + title: string + description: string +} + +const Error: React.FC = ({ code, title, description }) => ( +
+
+
+

{code}

+

+ {title} +

+

{description}

+
+ + Go back home + + +
+
+
+
+) + +export default Error -- cgit v1.2.3