diff --git a/packages/reva-candidate/cypress/e2e/candidacy-dropout/candidacy-dropout-warning.cy.ts b/packages/reva-candidate/cypress/e2e/candidacy-dropout/candidacy-dropout-warning.cy.ts index 2f194b2a4..d2c7b5fc4 100644 --- a/packages/reva-candidate/cypress/e2e/candidacy-dropout/candidacy-dropout-warning.cy.ts +++ b/packages/reva-candidate/cypress/e2e/candidacy-dropout/candidacy-dropout-warning.cy.ts @@ -45,6 +45,20 @@ context("Candidacy dropout warning", () => { cy.get('[data-test="drop-out-warning"]').should("exist"); }); + + it("should let me click the decision button and lead me to the decision page", function () { + interceptCandidacy({ droppedOut: true }); + cy.login(); + cy.wait("@candidate_login"); + cy.wait("@candidate_getCandidateWithCandidacy"); + cy.wait("@activeFeaturesForConnectedUser"); + + cy.get('[data-test="drop-out-warning-decision-button"]').click(); + cy.url().should( + "eq", + "http://localhost:3004/candidat/candidacy-dropout-decision/", + ); + }); }); context("When the candidacy has not been dropped out", () => { it("should not show the warning", function () { diff --git a/packages/reva-candidate/src/app/_components/drop-out-warning/DropOutWarning.tsx b/packages/reva-candidate/src/app/_components/drop-out-warning/DropOutWarning.tsx index 63bbfd374..a8e054174 100644 --- a/packages/reva-candidate/src/app/_components/drop-out-warning/DropOutWarning.tsx +++ b/packages/reva-candidate/src/app/_components/drop-out-warning/DropOutWarning.tsx @@ -1,31 +1,43 @@ import { format } from "date-fns"; import fvaeWarning from "./assets/fvae_warning.png"; import Image from "next/image"; +import Button from "@codegouvfr/react-dsfr/Button"; export const DropOutWarning = ({ dropOutDate, className, + onDecisionButtonClick, }: { dropOutDate: Date; className?: string; + onDecisionButtonClick?: () => void; }) => (
- main levée devant un panneau d'interdiction -
- Votre accompagnateur a déclaré l’abandon de votre parcours VAE le{" "} - {format(dropOutDate, "dd/MM/yyyy")}. Vous avez 6 mois pour enregistrer - votre décision : accepter l’abandon ou continuer votre parcours. +
+ main levée devant un panneau d'interdiction +
+ Votre accompagnateur a déclaré l’abandon de votre parcours VAE le{" "} + {format(dropOutDate, "dd/MM/yyyy")}. Vous avez 6 mois pour enregistrer + votre décision : accepter l’abandon ou continuer votre parcours. +
+
); diff --git a/packages/reva-candidate/src/app/page.tsx b/packages/reva-candidate/src/app/page.tsx index c7b6f5018..3a854a643 100644 --- a/packages/reva-candidate/src/app/page.tsx +++ b/packages/reva-candidate/src/app/page.tsx @@ -47,6 +47,9 @@ export default function Home() { + router.push("/candidacy-dropout-decision") + } /> )} {!candidacy.candidacyDropOut && }