2021-10-24 05:19:39 +02:00
|
|
|
import { render } from '@testing-library/react'
|
|
|
|
|
|
|
|
import { ErrorPage } from '../ErrorPage'
|
|
|
|
|
|
|
|
describe('<ErrorPage />', () => {
|
2021-10-24 05:48:06 +02:00
|
|
|
it('should render the message and statusCode', async () => {
|
|
|
|
const messageContent = 'message content'
|
2021-10-24 05:19:39 +02:00
|
|
|
const statusCode = 404
|
|
|
|
const { getByText } = render(
|
2021-10-24 05:48:06 +02:00
|
|
|
<ErrorPage statusCode={statusCode} message={messageContent} />
|
2021-10-24 05:19:39 +02:00
|
|
|
)
|
2021-10-24 05:48:06 +02:00
|
|
|
expect(getByText(messageContent)).toBeInTheDocument()
|
2021-10-24 05:19:39 +02:00
|
|
|
expect(getByText(statusCode)).toBeInTheDocument()
|
|
|
|
})
|
|
|
|
})
|