Skip to content

Commit

Permalink
Merge branch 'develop' into issues/8644/switch-bp-temp-fields-to-text…
Browse files Browse the repository at this point in the history
…formfield-with-type-number
  • Loading branch information
AdityaJ2305 authored Oct 9, 2024
2 parents cdd7c1b + 207365a commit 8a2a013
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 6 deletions.
12 changes: 12 additions & 0 deletions cypress/e2e/patient_spec/PatientHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ describe("Patient Homepage present functionalities", () => {
cy.awaitUrl("/patients");
});

it("Export the live patient list based on a date range", () => {
patientHome.clickPatientExport();
cy.verifyNotification("Please select a seven day period");
cy.closeNotification();
patientHome.typePatientModifiedBeforeDate("01122023");
patientHome.typePatientModifiedAfterDate("07122023");
patientHome.clickPatientFilterApply();
patientHome.interceptPatientExportRequest();
patientHome.clickPatientExport();
patientHome.verifyPatientExportRequest();
});

it("Verify the functionality of the patient tab pagination", () => {
let firstPatientPageOne: string;
cy.get('[data-cy="patient"]')
Expand Down
31 changes: 31 additions & 0 deletions cypress/pageobject/Patient/PatientHome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,36 @@ class PatientHome {
clickPreviousPage() {
cy.get("#prev-pages").click();
}

clickPatientExport() {
cy.get("#patient-export").click();
}

clickPatientFilterApply() {
cy.get("#apply-filter").click();
}

interceptPatientExportRequest() {
cy.intercept({
method: "GET",
url: "/api/v1/patient/*",
}).as("getPatients");
}

verifyPatientExportRequest() {
cy.wait("@getPatients").then((interception) => {
expect(interception.request.url).to.include("/api/v1/patient/");
expect(interception.request.url).to.include("&csv");
expect(interception.response.statusCode).to.eq(200);
});
}

typePatientModifiedBeforeDate(startDate: string) {
cy.clickAndTypeDate("input[name='modified_date_start']", startDate);
}

typePatientModifiedAfterDate(endDate: string) {
cy.clickAndTypeDate("input[name='modified_date_end']", endDate);
}
}
export default PatientHome;
10 changes: 5 additions & 5 deletions src/Components/Facility/FacilityCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -850,14 +850,14 @@ export const FacilityCreate = (props: FacilityProps) => {
required
types={["mobile", "landline"]}
/>
<div className="py-4 md:col-span-2">
<h4 className="mb-4">{t("spokes")}</h4>
{facilityId && (
{facilityId && (
<div className="py-4 md:col-span-2">
<h4 className="mb-4">{t("spokes")}</h4>
<SpokeFacilityEditor
facility={{ ...facilityQuery.data, id: facilityId }}
/>
)}
</div>
</div>
)}
<div className="grid grid-cols-1 gap-4 py-4 sm:grid-cols-2 md:col-span-2 xl:grid-cols-4">
<TextFormField
{...field("oxygen_capacity")}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ export const PatientManager = () => {
selected={qParams.ordering}
onSelect={updateQuery}
/>
<div className="tooltip w-full md:w-auto">
<div className="tooltip w-full md:w-auto" id="patient-export">
{!isExportAllowed ? (
<ButtonV2
onClick={() => {
Expand Down

0 comments on commit 8a2a013

Please sign in to comment.