1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

test: fix e2e tests + 500 error page

This commit is contained in:
2023-08-01 18:18:16 +02:00
parent 56520830e9
commit e51e3bdc19
6 changed files with 43 additions and 61 deletions

View File

@ -2,8 +2,6 @@
import { useEffect } from 'react'
import { ErrorPage } from '@/components/ErrorPage'
export interface ErrorHandlingProps {
error: Error
}
@ -15,7 +13,20 @@ const ErrorHandling = (props: ErrorHandlingProps): JSX.Element => {
console.error(error)
}, [error])
return <ErrorPage statusCode={500} message='Server error' />
return (
<main className='flex flex-col flex-1 items-center justify-center'>
<h1 className='my-6 text-4xl font-semibold'>
Error{' '}
<span
className='text-yellow dark:text-yellow-dark'
data-cy='status-code'
>
500
</span>
</h1>
<p className='text-center text-lg'>Server error</p>
</main>
)
}
export default ErrorHandling

View File

@ -1,11 +1,31 @@
import Link from 'next/link'
import { getI18n } from '@/i18n/i18n.server'
import { ErrorPage } from '@/components/ErrorPage'
const NotFound = (): JSX.Element => {
const i18n = getI18n()
return (
<ErrorPage statusCode={404} message={i18n.translate('errors.not-found')} />
<main className='flex flex-col flex-1 items-center justify-center'>
<h1 className='my-6 text-4xl font-semibold'>
{i18n.translate('errors.error')}{' '}
<span
className='text-yellow dark:text-yellow-dark'
data-cy='status-code'
>
404
</span>
</h1>
<p className='text-center text-lg'>
{i18n.translate('errors.not-found')}{' '}
<Link
href='/'
className='text-yellow hover:underline dark:text-yellow-dark'
>
{i18n.translate('errors.return-to-home-page')}
</Link>
</p>
</main>
)
}