diff --git a/.html-w3c-validatorrc.json b/.html-w3c-validatorrc.json index 1c94852..8cc95f3 100644 --- a/.html-w3c-validatorrc.json +++ b/.html-w3c-validatorrc.json @@ -1,8 +1,4 @@ { - "urls": [ - "http://127.0.0.1:3000/", - "http://127.0.0.1:3000/blog", - "http://127.0.0.1:3000/blog/hello-world" - ], + "urls": ["http://127.0.0.1:3000/", "http://127.0.0.1:3000/blog"], "files": ["./public/curriculum-vitae/index.html"] } diff --git a/app/error.tsx b/app/error.tsx index 5dcf921..4520702 100644 --- a/app/error.tsx +++ b/app/error.tsx @@ -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 + return ( +
+

+ Error{' '} + + 500 + +

+

Server error

+
+ ) } export default ErrorHandling diff --git a/app/not-found.tsx b/app/not-found.tsx index 1094c87..fb6ab10 100644 --- a/app/not-found.tsx +++ b/app/not-found.tsx @@ -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 ( - +
+

+ {i18n.translate('errors.error')}{' '} + + 404 + +

+

+ {i18n.translate('errors.not-found')}{' '} + + {i18n.translate('errors.return-to-home-page')} + +

+
) } diff --git a/components/ErrorPage.tsx b/components/ErrorPage.tsx deleted file mode 100644 index ca5c2d8..0000000 --- a/components/ErrorPage.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import Link from 'next/link' - -import { getI18n } from '@/i18n/i18n.server' - -export interface ErrorPageProps { - statusCode: number - message: string -} - -export const ErrorPage = (props: ErrorPageProps): JSX.Element => { - const { message, statusCode } = props - const i18n = getI18n() - - return ( -
-

- {i18n.translate('errors.error')}{' '} - - {statusCode} - -

-

- {message}{' '} - - {i18n.translate('errors.return-to-home-page')} - -

-
- ) -} diff --git a/cypress/e2e/common/Header.cy.ts b/cypress/e2e/common/Header.cy.ts index ff5ed53..cee85d3 100644 --- a/cypress/e2e/common/Header.cy.ts +++ b/cypress/e2e/common/Header.cy.ts @@ -37,15 +37,17 @@ describe('Common > Header', () => { }) describe('Switch Language', () => { - it('should switch locale from EN (default) to FR', () => { + it('should switch locale from English (default) to French', () => { cy.get('h1').contains('Théo LUDWIG') - cy.get('[data-cy=locale-flag-text]').contains('EN') + cy.get('[data-cy=locale-flag-text]').contains('English') cy.get('[data-cy=locales-list]').should('not.be.visible') cy.get('[data-cy=locale-click]').click() cy.get('[data-cy=locales-list]').should('be.visible') - cy.get('[data-cy=locales-list] > li:first-child').contains('FR').click() + cy.get('[data-cy=locales-list] > li:first-child') + .contains('French') + .click() cy.get('[data-cy=locales-list]').should('not.be.visible') - cy.get('[data-cy=locale-flag-text]').contains('FR') + cy.get('[data-cy=locale-flag-text]').contains('French') cy.get('h1').contains('Théo LUDWIG') }) diff --git a/cypress/e2e/pages/500.cy.ts b/cypress/e2e/pages/500.cy.ts deleted file mode 100644 index 2775197..0000000 --- a/cypress/e2e/pages/500.cy.ts +++ /dev/null @@ -1,11 +0,0 @@ -describe('Page /500', () => { - beforeEach(() => { - return cy.visit('/500', { failOnStatusCode: false }) - }) - - it('should display the statusCode of 500', () => { - cy.get('[data-cy=status-code]').contains('500') - }) -}) - -export {}