From e2e34a011d4f69979463f7fe651ca74086244916 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Tue, 14 May 2024 11:58:20 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(app-impress)=20add=20La=20Gaufre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add La Gaufre. It is a button to access easily to the La Suite products. --- .../e2e/__tests__/app-impress/header.spec.ts | 35 +++++++++++++++++++ src/frontend/apps/impress/package.json | 1 + .../src/features/header/ApplicationsMenu.tsx | 34 ------------------ .../impress/src/features/header/Header.tsx | 2 ++ .../impress/src/features/header/LaGaufre.tsx | 15 ++++++++ .../apps/impress/src/pages/_document.tsx | 6 ---- src/frontend/yarn.lock | 11 ++++-- 7 files changed, 61 insertions(+), 43 deletions(-) delete mode 100644 src/frontend/apps/impress/src/features/header/ApplicationsMenu.tsx create mode 100644 src/frontend/apps/impress/src/features/header/LaGaufre.tsx diff --git a/src/frontend/apps/e2e/__tests__/app-impress/header.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/header.spec.ts index 4f65aaf0..34cede2f 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/header.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/header.spec.ts @@ -35,5 +35,40 @@ test.describe('Header', () => { name: 'profile picture', }), ).toBeVisible(); + + await expect( + header.getByRole('button', { + name: 'Les services de La Suite numérique', + }), + ).toBeVisible(); + }); + + test('checks La Gauffre interaction', async ({ page }) => { + const header = page.locator('header').first(); + + await expect( + header.getByRole('button', { + name: 'Les services de La Suite numérique', + }), + ).toBeVisible(); + + /** + * La gaufre load a js file from a remote server, + * it takes some time to load the file and have the interaction available + */ + // eslint-disable-next-line playwright/no-wait-for-timeout + await page.waitForTimeout(1500); + + await header + .getByRole('button', { + name: 'Les services de La Suite numérique', + }) + .click(); + + await expect( + page.getByRole('link', { name: 'France Transfert' }), + ).toBeVisible(); + + await expect(page.getByRole('link', { name: 'Grist' })).toBeVisible(); }); }); diff --git a/src/frontend/apps/impress/package.json b/src/frontend/apps/impress/package.json index ff9bb916..019ffeb1 100644 --- a/src/frontend/apps/impress/package.json +++ b/src/frontend/apps/impress/package.json @@ -18,6 +18,7 @@ "@blocknote/core": "0.13.2", "@blocknote/mantine": "0.13.2", "@blocknote/react": "0.13.2", + "@gouvfr-lasuite/integration": "0.1.3", "@openfun/cunningham-react": "2.9.0", "@tanstack/react-query": "5.36.0", "grapesjs-blocks-basic": "1.0.2", diff --git a/src/frontend/apps/impress/src/features/header/ApplicationsMenu.tsx b/src/frontend/apps/impress/src/features/header/ApplicationsMenu.tsx deleted file mode 100644 index ca777561..00000000 --- a/src/frontend/apps/impress/src/features/header/ApplicationsMenu.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import Script from 'next/script'; -import React from 'react'; - -/** - * ApplicationsMenu Component - * - * This component is a work in progress (WIP) and serves as a proof of concept (POC) to showcase a future advanced feature. - * The purpose of this component is to render an applications menu for La Suite, allowing users to switch between different La Suite apps seamlessly. - * To ensure synchronized content across applications, it utilizes an iframe hosted on Scalingo. - * - * This PoC has been created by @manuhabitela. - * - * It includes external CSS and JavaScript files for styling and functionality. - * - * Style has to be included as well: https://suite-numerique-gaufre.osc-fr1.scalingo.io/public/styles/gaufre-vanilla.css \ - * To respect next.js standards, the css is included using the `_document.ts` component. - * @see https://github.com/numerique-gouv/impress/blob/main/src/frontend/apps/impress/src/pages/_document.tsx#L8 - */ -export const ApplicationsMenu = () => ( - <> -