From c914887405dc53da36ce57629544826593b35fe3 Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Mon, 29 Aug 2022 09:59:54 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9pare=20la=20navigation=20sur=20l'adresse?= =?UTF-8?q?=20/iframe/pamc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integration/mon-entreprise/iframe-pamc.ts | 18 ++++++++++++++++++ site/source/pages/Simulateurs/Home.tsx | 4 +++- site/source/pages/Simulateurs/PAMCHome.tsx | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 site/cypress/integration/mon-entreprise/iframe-pamc.ts diff --git a/site/cypress/integration/mon-entreprise/iframe-pamc.ts b/site/cypress/integration/mon-entreprise/iframe-pamc.ts new file mode 100644 index 000000000..603a2daf7 --- /dev/null +++ b/site/cypress/integration/mon-entreprise/iframe-pamc.ts @@ -0,0 +1,18 @@ +import { fr } from '../../support/utils' + +const inputSelector = 'div[aria-labelledby="simulator-legend"] input' + +describe('Iframe pamc', function () { + if (!fr) { + return + } + before(function () { + return cy.visit('/iframes/pamc') + }) + + it('should allow to navigate to the dentiste simulateur from iframe pamc home page', function () { + cy.contains('Chirurgien-dentiste').click() + cy.get(inputSelector).first().type('{selectall}50000') + cy.contains('CARCDSF') + }) +}) diff --git a/site/source/pages/Simulateurs/Home.tsx b/site/source/pages/Simulateurs/Home.tsx index ba7e8751e..4e1aff656 100644 --- a/site/source/pages/Simulateurs/Home.tsx +++ b/site/source/pages/Simulateurs/Home.tsx @@ -170,7 +170,9 @@ export function SimulateurCard({ } - to={{ pathname: (isIframe && iframePath) || path }} + to={{ + pathname: (isIframe && `/iframes/${iframePath ?? ''}`) || path, + }} state={fromGérer ? { fromGérer: true } : { fromSimulateurs: true }} title={

diff --git a/site/source/pages/Simulateurs/PAMCHome.tsx b/site/source/pages/Simulateurs/PAMCHome.tsx index 8cdb14b3a..2b8edd56b 100644 --- a/site/source/pages/Simulateurs/PAMCHome.tsx +++ b/site/source/pages/Simulateurs/PAMCHome.tsx @@ -5,6 +5,7 @@ import useSimulatorsData from './metadata' export default function SalariéSimulation() { const simulators = useSimulatorsData() + console.log(simulators) return ( <>