Skip to content

Commit

Permalink
fix(admin): improved isDirty props in certificationPageLogic form whi…
Browse files Browse the repository at this point in the history
…le certificationPartComplete is false
  • Loading branch information
fbonniec committed Dec 11, 2024
1 parent 2c7aca2 commit 3116dd3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe("Dematerialized Feasibility File Certification Page", () => {
cy.get('[data-test="form-buttons"]')
.should("exist")
.within(() => {
cy.get("button").should("be.disabled");
cy.get("button").should("not.be.disabled");
});

cy.get('input[type="checkbox"]').should("be.checked");
Expand All @@ -84,7 +84,7 @@ describe("Dematerialized Feasibility File Certification Page", () => {
cy.get('[data-test="form-buttons"]')
.should("exist")
.within(() => {
cy.get("button").should("be.disabled");
cy.get("button").should("not.be.disabled");
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const getCandidacyById = graphql(`
firstForeignLanguage
secondForeignLanguage
option
certificationPartComplete
blocsDeCompetences {
certificationCompetenceBloc {
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ const CertificationPage = () => {
<FormButtons
backUrl={`/candidacies/${candidacyId}/feasibility-aap`}
formState={{
isDirty: isDirty,
isDirty:
isDirty ||
!dematerializedFeasibilityFile?.certificationPartComplete,
canSubmit:
completion == "PARTIAL" &&
competenceBlocFields.every((bloc) => !bloc.checked)
Expand Down

0 comments on commit 3116dd3

Please sign in to comment.