♻️ refactor(ErrorPage): use Mui components

This commit is contained in:
2024-01-20 16:07:25 +01:00
parent 8aff802faa
commit af3274f881
2 changed files with 17 additions and 17 deletions
@@ -17,12 +17,13 @@ describe('Renders ErrorPage correctly', async () => {
* Passes - shows title correctly
*/
it('Should render the error page correctly', () => {
const router = createMemoryRouter([{ path: '/', element: <div />, errorElement: <ErrorPage /> }], { initialEntries: ['/some/bad/route'] })
const badRoute = '/some/bad/route'
const router = createMemoryRouter([{ path: '/', element: <div />, errorElement: <ErrorPage /> }], { initialEntries: [badRoute] })
render(<RouterProvider router={router} />)
expect(screen.getByText('Oops!')).toBeInTheDocument()
expect(screen.getByText('Sorry, an unexpected error has occurred.')).toBeInTheDocument()
expect(screen.getByText('404 Not Found')).toBeInTheDocument()
expect(screen.getByText(`404 Error: No route matches URL "${badRoute}"`)).toBeInTheDocument()
})
})