Skip to content

Commit

Permalink
feat(admin): added an update certifification prerequisites update but…
Browse files Browse the repository at this point in the history
…ton on the registry manager certification update prerequisites summary card
  • Loading branch information
agarbe committed Dec 11, 2024
1 parent 21c5c1c commit 185fede
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,28 @@ context("when i access the update certification page ", () => {
'[data-test="prerequisites-summary-card"] [data-test="prerequisite-list"] > li',
).should("have.length", 2);
});

it("let me click on the 'update' button of the prerequisites summary card and leads me to the correct page", function () {
interceptCertification({ withPrerequisites: true });

cy.admin(
"/responsable-certifications/certifications/bf78b4d6-f6ac-4c8f-9e6b-d6c6ae9e891b",
);
cy.wait("@activeFeaturesForConnectedUser");
cy.wait("@getOrganismForAAPVisibilityCheck");
cy.wait("@getMaisonMereCGUQuery");
cy.wait(
"@getCertificationForCertificationRegistryManagerUpdateCertificationPage",
);

cy.get(
'[data-test="prerequisites-summary-card"] [data-test="action-button"]',
).click();

cy.url().should(
"eq",
"http://localhost:3003/admin2/responsable-certifications/certifications/bf78b4d6-f6ac-4c8f-9e6b-d6c6ae9e891b/prerequisites/",
);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ const PageContent = ({
data-test="prerequisites-summary-card"
title="Prérequis obligatoires"
titleIconClass="fr-icon-success-fill"
hasButton
buttonTitle="Modifier"
buttonPriority="secondary"
buttonOnClick={() =>
router.push(
`/responsable-certifications/certifications/${certification.id}/prerequisites`,
)
}
>
{certification.prerequisites.length ? (
<ul className="ml-10" data-test="prerequisite-list">
Expand Down

0 comments on commit 185fede

Please sign in to comment.