Skip to content

Commit

Permalink
Added Cypress test for adding doctor's note.
Browse files Browse the repository at this point in the history
Added test that adds doctor's note to a patient and verifies if
the note has been added successfully.

Fixes #4235
  • Loading branch information
SahilSingh177 committed Jun 10, 2023
1 parent 61d0549 commit ae05c86
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions cypress/e2e/patient_spec/patient_crud.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ describe("Patient Creation with consultation", () => {
cy.get("button#submit").should("be.visible").click();
cy.get("[data-testid='return-to-patient-dashboard']").click();
});

it("Doctor's Note Addition", () => {
cy.visit(patient_url + "/notes");
cy.get("textarea").type("Patient Note");
cy.get("button").contains("Post Your Note").click();
cy.wait(1000);
cy.verifyNotification("Note added successfully");
cy.get("span.added_notes").first().should("contain", "Patient Note");
});

afterEach(() => {
cy.saveLocalStorage();
});
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Patient/PatientNotes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const PatientNotes = (props: PatientNotesProps) => {
key={note.id}
className="flex p-4 bg-white rounded-lg text-gray-800 mt-4 flex-col w-full border border-gray-300"
>
<span className="whitespace-pre">{note.note}</span>
<span className="whitespace-pre added_notes">{note.note}</span>
<div className="mt-3">
<span className="text-xs text-gray-500">
{formatDate(note.created_date) || "-"}
Expand Down

0 comments on commit ae05c86

Please sign in to comment.