Skip to content

Commit

Permalink
Enhance the multi-select component to immediately open onFocus (#8598)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: Khavin Shankar <[email protected]>
Co-authored-by: rithviknishad <[email protected]>
  • Loading branch information
3 people authored Sep 24, 2024
1 parent effeaf9 commit 214b373
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
21 changes: 8 additions & 13 deletions cypress/e2e/facility_spec/FacilityHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ describe("Facility Homepage Function", () => {
const userPage = new UserPage();
const assetPagination = new AssetPagination();
const facilitiesAlias = "downloadFacilitiesCSV";
const capacitiesAlias = "downloadCapacitiesCSV";
const doctorsAlias = "downloadDoctorsCSV";
const triagesAlias = "downloadTriagesCSV";
const facilityName = "Dummy Facility 40";
Expand Down Expand Up @@ -91,30 +90,26 @@ describe("Facility Homepage Function", () => {
});

it("Verify Facility Export Functionality", () => {
// Download the Facilities CSV
// Verify Facility Export
facilityHome.csvDownloadIntercept(facilitiesAlias, "");
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Facilities");
facilityHome.verifyDownload(facilitiesAlias);
facilityHome.clickSearchButton(); // to avoid flaky test, as sometimes, the test is unable to focus on the object
// Download the Capacities CSV
facilityHome.csvDownloadIntercept(capacitiesAlias, "&capacity");
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Capacities");
facilityHome.verifyDownload(capacitiesAlias);
facilityHome.clickSearchButton();
// Download the Doctors CSV
// Verify Doctor Export
facilityHome.csvDownloadIntercept(doctorsAlias, "&doctors");
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Doctors");
facilityHome.verifyDownload(doctorsAlias);
facilityHome.clickSearchButton();
// Download the Triages CSV
// Verify Triage Export
facilityHome.csvDownloadIntercept(triagesAlias, "&triage");
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Triages");
facilityHome.verifyDownload(triagesAlias);
facilityHome.clickSearchButton();
});

it("Verify Capacity Export Functionality", () => {
facilityHome.clickExportButton();
facilityHome.clickMenuItem("Capacities");
});

it("Verify Facility Detail page redirection to CNS and Live Minitoring ", () => {
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
const additionalSymptoms = "Fever";
const physicalExamination = "physical examination details";
const otherExamination = "Other";
const patientSystolic = "119";
const patientDiastolic = "150";
const patientModifiedSystolic = "120";
const patientModifiedDiastolic = "145";
const patientSystolic = "149";
const patientDiastolic = "119";
const patientModifiedSystolic = "145";
const patientModifiedDiastolic = "120";
const patientPulse = "152";
const patientTemperature = "96.6";
const patientRespiratory = "140";
Expand Down
5 changes: 4 additions & 1 deletion cypress/pageobject/Facility/FacilityHome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class FacilityHome {

// Operations
clickExportButton() {
cy.get(this.exportButton).scrollIntoView();
cy.get(this.exportButton).click();
}

Expand Down Expand Up @@ -89,7 +90,9 @@ class FacilityHome {
}

verifyDownload(alias: string) {
cy.wait(`@${alias}`).its("response.statusCode").should("eq", 200);
cy.wait(`@${alias}`, { timeout: 60000 })
.its("response.statusCode")
.should("eq", 200);
}

getURL() {
Expand Down
1 change: 1 addition & 0 deletions src/Components/Form/AutoCompleteAsync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const AutoCompleteAsync = (props: Props) => {
onChange={onChange}
by={compareBy}
multiple={multiple as any}
immediate
>
<div className="relative mt-1">
<div className="flex">
Expand Down
1 change: 1 addition & 0 deletions src/Components/Form/FormFields/AutocompleteMultiselect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export const AutocompleteMutliSelect = <T, V>(
return (
<div className={props.className} id={props.id}>
<Combobox
immediate
disabled={props.disabled}
value={value}
multiple
Expand Down

0 comments on commit 214b373

Please sign in to comment.