From c1dd34512b025544daf05bc55e4fd339e82419ff Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Tue, 14 May 2024 11:46:13 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8(app-impress)=20footer=20legales=20?= =?UTF-8?q?pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add legales pages. - Add links to the footer for the new pages. Legales pages are based from https://lasuite.numerique.gouv.fr/ --- .../e2e/__tests__/app-impress/footer.spec.ts | 34 +++++ .../impress/src/features/footer/Footer.tsx | 52 ++++++- .../impress/src/features/header/Header.tsx | 16 +- .../apps/impress/src/layouts/PageLayout.tsx | 17 +++ .../apps/impress/src/layouts/index.ts | 1 + .../impress/src/pages/accessibility/index.tsx | 137 ++++++++++++++++++ .../impress/src/pages/legal-notice/index.tsx | 67 +++++++++ .../src/pages/personal-data-cookies/index.tsx | 110 ++++++++++++++ 8 files changed, 426 insertions(+), 8 deletions(-) create mode 100644 src/frontend/apps/impress/src/layouts/PageLayout.tsx create mode 100644 src/frontend/apps/impress/src/pages/accessibility/index.tsx create mode 100644 src/frontend/apps/impress/src/pages/legal-notice/index.tsx create mode 100644 src/frontend/apps/impress/src/pages/personal-data-cookies/index.tsx diff --git a/src/frontend/apps/e2e/__tests__/app-impress/footer.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/footer.spec.ts index 5aa6d546..8d9eb995 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/footer.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/footer.spec.ts @@ -33,10 +33,44 @@ test.describe('Footer', () => { footer.getByRole('link', { name: 'data.gouv.fr' }), ).toBeVisible(); + await expect( + footer.getByRole('link', { name: 'Legal Notice' }), + ).toBeVisible(); + + await expect( + footer.getByRole('link', { name: 'Personal data and cookies' }), + ).toBeVisible(); + + await expect( + footer.getByRole('link', { name: 'Accessibility' }), + ).toBeVisible(); + await expect( footer.getByText( 'Unless otherwise stated, all content on this site is under licence', ), ).toBeVisible(); }); + + const legalPages = [ + { name: 'Legal Notice', url: '/legal-notice/' }, + { name: 'Personal data and cookies', url: '/personal-data-cookies/' }, + { name: 'Accessibility', url: '/accessibility/' }, + ]; + for (const { name, url } of legalPages) { + test(`checks ${name} page`, async ({ page }) => { + const footer = page.locator('footer').first(); + await footer.getByRole('link', { name }).click(); + + await expect( + page + .getByRole('heading', { + name, + }) + .first(), + ).toBeVisible(); + + await expect(page).toHaveURL(url); + }); + } }); diff --git a/src/frontend/apps/impress/src/features/footer/Footer.tsx b/src/frontend/apps/impress/src/features/footer/Footer.tsx index fa18db7e..8addd850 100644 --- a/src/frontend/apps/impress/src/features/footer/Footer.tsx +++ b/src/frontend/apps/impress/src/features/footer/Footer.tsx @@ -37,6 +37,7 @@ export const Footer = () => { $gap="1.5rem" $align="center" $justify="space-between" + $css="flex-wrap: wrap;" > @@ -50,7 +51,6 @@ export const Footer = () => { { ))} + + {[ + { + label: t('Legal Notice'), + href: '/legal-notice', + }, + { + label: t('Personal data and cookies'), + href: '/personal-data-cookies', + }, + { + label: t('Accessibility'), + href: '/accessibility', + }, + ].map(({ label, href }) => ( + + + {label} + + + ))} + { src={IconGouv} alt={t('Freedom Equality Fraternity Logo')} /> - - {t('Impress - - {t('Impress')} - - + + + {t('Impress + + {t('Impress')} + + + +
+ + {children} + +