Skip to content

Commit

Permalink
Migrate to Headless UI v2 (#8260)
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar authored Aug 22, 2024
1 parent ca56ccc commit 9344783
Show file tree
Hide file tree
Showing 37 changed files with 620 additions and 409 deletions.
7 changes: 2 additions & 5 deletions cypress/e2e/external_results_spec/filter.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ describe("External Results Filters", () => {
});

it("Advance Filter", () => {
cy.clickAndSelectOption("#local_bodies", "Aluva");
cy.get("#local_bodies").click();
cy.get("[role='option']").should("be.visible");
cy.contains("[role='option']", "Aluva").click();
cy.get("#local_bodies").click();
cy.clickAndSelectOption("#wards", "4");
cy.get("#wards").click();
cy.get("[role='option']").should("be.visible");
cy.contains("[role='option']", "4").click();
cy.contains("Apply").click();
});

Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/facility_spec/facility_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ describe("Facility Creation", () => {
facilityFeature.forEach((featureText) => {
cy.get("[role='option']").contains(featureText).click();
});
facilityPage.clickfacilityfeatureoption();
facilityPage.fillPincode("682001");
facilityPage.selectStateOnPincode("Kerala");
facilityPage.selectDistrictOnPincode("Ernakulam");
Expand Down
6 changes: 4 additions & 2 deletions cypress/e2e/patient_spec/patient_logupdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectRoundType("Telemedicine");
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.typeAdditionalSymptoms(additionalSymptoms);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
Expand All @@ -72,7 +73,8 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.typeAdditionalSymptoms(additionalSymptoms);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/patient_prescription.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe("Patient Medicine Administration", () => {
cy.verifyAndClickElement("#0", medicineNameOne);
cy.submitButton("Discontinue");
patientPrescription.enterDiscontinueReason("Medicine is been discontinued");
cy.submitButton("Discontinue");
cy.submitButton("Confirm Discontinue");
cy.verifyNotification("Prescription discontinued");
cy.closeNotification();
// verify the discontinue medicine view
Expand Down
4 changes: 0 additions & 4 deletions cypress/pageobject/Patient/PatientLogupdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ class PatientLogupdate {
cy.get("#other_details").click().type(details);
}

typeAdditionalSymptoms(symptoms: string) {
cy.searchAndSelectOption("#additional_symptoms", symptoms);
}

typeAndMultiSelectSymptoms(input, symptoms) {
cy.typeAndMultiSelectOption("#additional_symptoms", input, symptoms);
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Users/ManageUserPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class ManageUserPage {
}

clickCloseSlideOver() {
cy.get("#close-slide-over").click();
cy.get("#close-slide-over").click({ force: true });
}

clickHomeFacilityIcon() {
Expand Down
3 changes: 3 additions & 0 deletions cypress/pageobject/Users/UserCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export class UserCreationPage {
selectFacility(name: string) {
this.typeIntoInputByName("facilities", name);
this.selectOptionContainingText(name);
cy.get("input[name='facilities'] + button")
.find("#dropdown-toggle")
.click();
}

selectHomeFacility(name: string) {
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Cypress.Commands.add(
optionArray.forEach((options) => {
cy.get("[role='option']").contains(options).click();
});
cy.get(selector).click();
cy.get(selector).find("#dropdown-toggle").click();
});
},
);
Expand All @@ -153,7 +153,7 @@ Cypress.Commands.add(
optionArray.forEach((options) => {
cy.get("[role='option']").contains(options).click();
});
cy.get(selector).click();
cy.get(selector).find("#dropdown-toggle").click();
});
},
);
Expand Down
194 changes: 172 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@fontsource/inter": "^5.0.18",
"@googlemaps/react-wrapper": "^1.1.35",
"@googlemaps/typescript-guards": "^2.0.3",
"@headlessui/react": "^1.7.15",
"@headlessui/react": "^2.1.2",
"@pnotify/core": "^5.2.0",
"@pnotify/mobile": "^5.2.0",
"@sentry/browser": "^8.12.0",
Expand Down
Loading

0 comments on commit 9344783

Please sign in to comment.