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:
@ -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
|
||||
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user