Skip to content

Commit

Permalink
test: Fix admin e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGT96 committed Jan 9, 2025
1 parent 470e2fb commit 62484ce
Show file tree
Hide file tree
Showing 53 changed files with 55 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe("Add Disease Activity specs", () => {

it("should cancel the disease creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("activity-title").contains("Diseases");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe("Diseases Edit Activity specs", () => {

it("should cancel the disease update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("activity-title").contains("Diseases");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe("Add exam Activity specs", () => {

it("should cancel the exam creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("activity-title").contains("Exams");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("Exams edit activity specs", () => {

it("should cancel the exam update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("activity-title").contains("Exams");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("Edit Hospital Activity specs", () => {
it("should cancel the update of the hospital infos", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("dialog-info").contains("lost");
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("activity-title").contains("Wards");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe("Add Operation Activity specs", () => {

it("should cancel the operation creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("activity-title").contains("Operations");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe("Operations Edit Activity specs", () => {

it("should cancel the operation update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("activity-title").contains("Operations");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Add admission type Activity specs", () => {

it("should cancel the admission type creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage admission types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("Admission types Edit Activity specs", () => {

it("should cancel the admission type update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage admission types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("Admission types Edit Activity specs", () => {

it("should cancel the age types update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage age types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("Add delivery type Activity specs", () => {

it("should cancel the delivery type creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-delivery-title").contains("Manage delivery types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("Delivery types Edit Activity specs", () => {

it("should cancel the delivery type update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-delivery-title").contains("Manage delivery types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Add delivery result type Activity specs", () => {

it("should cancel the delivery result type creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage delivery result types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("Delivery result types Edit Activity specs", () => {

it("should cancel the delivery result type update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage delivery result types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Add discharge type Activity specs", () => {

it("should cancel the discharge type creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-discharge-title").contains("Manage discharge types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("Discharge types Edit Activity specs", () => {

it("should cancel the discharge type update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-discharge-title").contains("Manage discharge types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Add disease type Activity specs", () => {

it("should cancel the disease type creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage disease types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("Disease types Edit Activity specs", () => {

it("should cancel the disease type update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage disease types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Add exam type Activity specs", () => {

it("should cancel the exam type creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage exam types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("Exam types Edit Activity specs", () => {

it("should cancel the exam type update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage exam types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Add medical type Activity specs", () => {

it("should cancel the medical type creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-medical-title").contains("Manage medical types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("Medical types Edit Activity specs", () => {

it("should cancel the medical type update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-medical-title").contains("Manage medical types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Add operation type Activity specs", () => {

it("should cancel the operation type creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-operation-title").contains("Manage operation types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("Operation types Edit Activity specs", () => {

it("should cancel the operation type update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-operation-title").contains("Manage operation types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("Add pregnant treatment type Activity specs", () => {

it("should cancel the pregnant treatment type creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage pregnant treatment types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("Pregnant treatment types Edit Activity specs", () => {

it("should cancel the pregnant treatment type update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage pregnant treatment types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Add vaccine type Activity specs", () => {

it("should cancel the vaccine type creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage vaccine types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("vaccine types Edit Activity specs", () => {

it("should cancel the vaccine type update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("sub-activity-title").contains("Manage vaccine types");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Add Vaccine Activity specs", () => {

it("should cancel the vaccine creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("activity-title").contains("Vaccines");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("Vaccines Edit Activity specs", () => {

it("should cancel the vaccine update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("activity-title").contains("Vaccines");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe("Add Ward Activity specs", () => {

it("should cancel the ward creation", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("activity-title").contains("Wards");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Edit Ward Activity specs", () => {

it("should cancel the ward update", () => {
cy.dataCy("cancel-form").click();
cy.dataCy("approve-dialog").click();
cy.dataCy("approve-dialog").click().click();
cy.dataCy("dialog-info").should("not.exist");
cy.dataCy("activity-title").contains("Wards");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("Wards Activity specs", () => {
});

it("should cancel the ward deletion", () => {
cy.dataCy("close-dialog").click();
cy.dataCy("close-dialog").click().click();
cy.dataCy("dialog-info").should("not.be.visible");
cy.dataCy("wards-table")
.find("table")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ const DiseaseForm: FC<IDiseaseProps> = ({
}
primaryButtonLabel="Ok"
handlePrimaryButtonClick={() => {
navigate(PATHS.admin_diseases);
navigate(PATHS.admin_diseases, { replace: true });
}}
handleSecondaryButtonClick={() => ({})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ const ExamForm: FC<IExamProps> = ({
}
primaryButtonLabel="Ok"
handlePrimaryButtonClick={() => {
navigate(PATHS.admin_exams);
navigate(PATHS.admin_exams, { replace: true });
}}
handleSecondaryButtonClick={() => ({})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ const HospitalForm: FC<IHospitalFormProps> = ({
info={t("hospital.updateSuccess")}
primaryButtonLabel="Ok"
handlePrimaryButtonClick={() => {
navigate(PATHS.admin);
navigate(PATHS.admin, { replace: true });
}}
handleSecondaryButtonClick={() => ({})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ const OperationForm: FC<IOperationProps> = ({
}
primaryButtonLabel="Ok"
handlePrimaryButtonClick={() => {
navigate(PATHS.admin_operations);
navigate(PATHS.admin_operations, { replace: true });
}}
handleSecondaryButtonClick={() => ({})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const SupplierForm: FC<ISupplierFormProps> = ({
}
primaryButtonLabel="Ok"
handlePrimaryButtonClick={() => {
navigate(PATHS.admin_suppliers);
navigate(PATHS.admin_suppliers, { replace: true });
}}
handleSecondaryButtonClick={() => ({})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const AdmissionTypeForm: FC<IAdmissionTypeFormProps> = ({
}
primaryButtonLabel="Ok"
handlePrimaryButtonClick={() => {
navigate(PATHS.admin_admissions_types);
navigate(PATHS.admin_admissions_types, { replace: true });
}}
handleSecondaryButtonClick={() => ({})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ const AgeTypesForm: FC<IAgeTypesFormProps> = ({
info={t("ageTypes.updateSuccess")}
primaryButtonLabel="Ok"
handlePrimaryButtonClick={() => {
navigate(PATHS.admin_age_types);
navigate(PATHS.admin_age_types, { replace: true });
}}
handleSecondaryButtonClick={() => ({})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const DeliveryTypeForm: FC<IDeliveryTypeFormProps> = ({
}
primaryButtonLabel="Ok"
handlePrimaryButtonClick={() => {
navigate(PATHS.admin_deliveries_types);
navigate(PATHS.admin_deliveries_types, { replace: true });
}}
handleSecondaryButtonClick={() => ({})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const DeliveryResultTypeForm: FC<IDeliveryResultTypeFormProps> = ({
}
primaryButtonLabel="Ok"
handlePrimaryButtonClick={() => {
navigate(PATHS.admin_delivery_result_types);
navigate(PATHS.admin_delivery_result_types, { replace: true });
}}
handleSecondaryButtonClick={() => ({})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const DischargeTypeForm: FC<IDischargeTypeFormProps> = ({
}
primaryButtonLabel="Ok"
handlePrimaryButtonClick={() => {
navigate(PATHS.admin_discharges_types);
navigate(PATHS.admin_discharges_types, { replace: true });
}}
handleSecondaryButtonClick={() => ({})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const DiseaseTypeForm: FC<IDiseaseTypeFormProps> = ({
}
primaryButtonLabel="Ok"
handlePrimaryButtonClick={() => {
navigate(PATHS.admin_diseases_types);
navigate(PATHS.admin_diseases_types, { replace: true });
}}
handleSecondaryButtonClick={() => ({})}
/>
Expand Down
Loading

0 comments on commit 62484ce

Please sign in to comment.