Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/DonXavierdev/care_fe int…
Browse files Browse the repository at this point in the history
…o issues/10551/Delete-Button-Locations
  • Loading branch information
DonXavierdev committed Mar 2, 2025
2 parents 8aa2c02 + 957f5e5 commit da625f0
Show file tree
Hide file tree
Showing 158 changed files with 8,227 additions and 3,412 deletions.
3 changes: 3 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn"

# ISO 3166-1 Alpha-2 code for the default country code (default: "IN")
REACT_DEFAULT_COUNTRY=

# Maps fallback URL template (default:"https://www.openstreetmap.org/?mlat={lat}&mlon={long}&zoom=15")
REACT_MAPS_FALLBACK_URL_TEMPLATE=
48 changes: 0 additions & 48 deletions .github/workflows/issue-automation.yml

This file was deleted.

4 changes: 4 additions & 0 deletions care.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const careConfig = {
defaultEncounterType: (env.REACT_DEFAULT_ENCOUNTER_TYPE ||
"hh") as EncounterClass,

mapFallbackUrlTemplate:
env.REACT_MAPS_FALLBACK_URL_TEMPLATE ||
"https://www.openstreetmap.org/?mlat={lat}&mlon={long}&zoom=15",

gmapsApiKey:
env.REACT_GMAPS_API_KEY || "AIzaSyDsBAc3y7deI5ZO3NtK5GuzKwtUzQNJNUk",

Expand Down
4 changes: 4 additions & 0 deletions cypress/e2e/patient_spec/patient_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const patientEncounter = new PatientEncounter();
const ENCOUNTER_TYPE = "Observation";
const ENCOUNTER_STATUS = "In Progress";
const ENCOUNTER_PRIORITY = "ASAP";
const ORGANIZATION_NAME = "Administration";

describe("Patient Management", () => {
const TEST_PHONE = "9495031234";
Expand Down Expand Up @@ -100,6 +101,7 @@ describe("Patient Management", () => {
];

beforeEach(() => {
cy.viewport(1920, 1080);
cy.loginByApi("doctor");
cy.visit("/");
});
Expand All @@ -122,6 +124,7 @@ describe("Patient Management", () => {
.selectEncounterType(ENCOUNTER_TYPE)
.selectEncounterStatus(ENCOUNTER_STATUS)
.selectEncounterPriority(ENCOUNTER_PRIORITY)
.selectOrganization(ORGANIZATION_NAME)
.clickSubmitEncounter()
.assertEncounterCreationSuccess();

Expand Down Expand Up @@ -150,6 +153,7 @@ describe("Patient Management", () => {
.selectEncounterType(ENCOUNTER_TYPE)
.selectEncounterStatus(ENCOUNTER_STATUS)
.selectEncounterPriority(ENCOUNTER_PRIORITY)
.selectOrganization(ORGANIZATION_NAME)
.clickSubmitEncounter()
.assertEncounterCreationSuccess();

Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/patient_spec/patient_details.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const patientDetails = new PatientDetails();

describe("Patient Management", () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.loginByApi("devdoctor");
cy.visit("/");
});
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/patient_spec/patient_encounter.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const patientEncounter = new PatientEncounter();

describe("Patient Encounter Questionnaire", () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.loginByApi("devnurse");
cy.visit("/");
});
Expand Down
22 changes: 22 additions & 0 deletions cypress/e2e/users_spec/user_avatar.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { UserAvatar } from "@/pageObject/Users/UserAvatar";

describe("User Profile Avatar Modification", () => {
const userAvatar = new UserAvatar("teststaff4");
beforeEach(() => {
cy.loginByApi("teststaff4");
cy.visit("/");
});
it("should modify an avatar", () => {
userAvatar
.navigateToProfile()
.interceptUploadAvatarRequest()
.clickChangeAvatarButton()
.uploadAvatar()
.clickSaveAvatarButton()
.verifyUploadAvatarApiCall()
.interceptDeleteAvatarRequest()
.clickChangeAvatarButton()
.clickDeleteAvatarButton()
.verifyDeleteAvatarApiCall();
});
});
Binary file added cypress/fixtures/avatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions cypress/fixtures/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@
"devdoctor": {
"username": "developdoctor",
"password": "Test@123"
},
"teststaff4": {
"username": "teststaff4",
"password": "Test@123"
}
}
5 changes: 5 additions & 0 deletions cypress/pageObject/Patients/PatientVerify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ class PatientVerify {
return this;
}

selectOrganization(organization: string) {
cy.clickAndSelectOption('[data-cy="facility-organization"]', organization);
return this;
}

clickSubmitEncounter() {
cy.clickSubmitButton("Create Encounter");
return this;
Expand Down
59 changes: 59 additions & 0 deletions cypress/pageObject/Users/UserAvatar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
export class UserAvatar {
username: string;
constructor(username: string) {
this.username = username;
}

navigateToProfile() {
cy.visit(`/users/${this.username}`);
return this;
}

interceptUploadAvatarRequest() {
cy.intercept("POST", `/api/v1/users/${this.username}/profile_picture/`).as(
"uploadAvatar",
);
return this;
}

clickChangeAvatarButton() {
cy.verifyAndClickElement('[data-cy="change-avatar"]', "Change Avatar");
return this;
}

uploadAvatar() {
cy.get('input[title="changeFile"]').selectFile(
"cypress/fixtures/avatar.jpg",
{ force: true },
);
return this;
}

clickSaveAvatarButton() {
cy.verifyAndClickElement('[data-cy="save-cover-image"]', "Save");
return this;
}

verifyUploadAvatarApiCall() {
cy.wait("@uploadAvatar").its("response.statusCode").should("eq", 200);
return this;
}

interceptDeleteAvatarRequest() {
cy.intercept(
"DELETE",
`/api/v1/users/${this.username}/profile_picture/`,
).as("deleteAvatar");
return this;
}

clickDeleteAvatarButton() {
cy.verifyAndClickElement('[data-cy="delete-avatar"]', "Delete");
return this;
}

verifyDeleteAvatarApiCall() {
cy.wait("@deleteAvatar").its("response.statusCode").should("eq", 204);
return this;
}
}
Loading

0 comments on commit da625f0

Please sign in to comment.