Skip to content

Commit

Permalink
added bed number selection to the consultation test
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 committed Aug 21, 2024
1 parent 9a5e833 commit 529dc1e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions cypress/e2e/patient_spec/patient_consultation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ describe("Patient Consultation in multiple combination", () => {
cy.submitButton("Create Consultation");
// the above submit should fail as IP number is missing
patientConsultationPage.typePatientNumber(patientIpNumber);
patientConsultationPage.selectBed("Dummy Bed 1");
cy.submitButton("Create Consultation");
cy.verifyNotification("Consultation created successfully");
// Below code for the prescription module only present while creating a new consultation
Expand Down
4 changes: 4 additions & 0 deletions cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export class PatientConsultationPage {
cy.searchAndSelectOption("#referred_to", referance);
}

selectBed(bedNo: string) {
cy.searchAndSelectOption("#bed", bedNo);
}

selectPatientWard(ward: string) {
cy.searchAndSelectOption("#transferred_from_location", ward);
}
Expand Down
1 change: 1 addition & 0 deletions src/Components/Common/BedSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const BedSelect = (props: BedSelectProps) => {

return (
<AutoCompleteAsync
id={name}
name={name}
multiple={multiple}
selected={selected}
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
admitted: data.admitted ? String(data.admitted) : "false",
admitted_to: data.admitted_to ? data.admitted_to : "",
category: data.category
? (PATIENT_CATEGORIES.find((i) => i.text === data.category)?.id ??
"")
? PATIENT_CATEGORIES.find((i) => i.text === data.category)?.id ??

Check failure on line 390 in src/Components/Facility/ConsultationForm.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `(`
""

Check failure on line 391 in src/Components/Facility/ConsultationForm.tsx

View workflow job for this annotation

GitHub Actions / lint

Insert `)`
: "",
patient_no: data.patient_no ?? "",
OPconsultation: data.consultation_notes,
Expand Down

0 comments on commit 529dc1e

Please sign in to comment.