Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update styling for the side nav #8789

Merged
merged 15 commits into from
Oct 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed all the cypress failures
nihal467 committed Oct 16, 2024
commit 5ab1e755df7b74157e0b54a6e815f85036d26254
1 change: 1 addition & 0 deletions cypress/e2e/auth_spec/auth.cy.ts
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ describe("Authorisation/Authentication", () => {
it("Try login as admin with correct password", () => {
cy.loginByApi("devdistrictadmin", "Coronasafe@123");
cy.awaitUrl("/facility");
cy.get("#user-profile-name").click();
cy.get("#sign-out-button").contains("Sign Out").click();
cy.url().should("include", "/");
});
3 changes: 1 addition & 2 deletions cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ describe("Patient Doctor Connect in consultation page", () => {
const doctorconnect = new DoctorConnect();
const patientName = "Dummy Patient 11";
const doctorUser = "Dev Doctor";
const doctorUserNumber = "+919876543219";
const nurseUser = "Dev Staff";
const teleIcuUser = "Dev Doctor Two";

@@ -37,7 +36,7 @@ describe("Patient Doctor Connect in consultation page", () => {
"#doctor-connect-home-doctor",
doctorUser,
);
doctorconnect.verifyCopiedContent(doctorUserNumber);
doctorconnect.verifyCopiedContent();
// verify the whatsapp and phone number icon presence
doctorconnect.verifyIconVisible("#whatsapp-icon");
doctorconnect.verifyIconVisible("#phone-icon");
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ describe("Patient Discussion notes in the consultation page", () => {
cy.verifyNotification(discussionNotesSuccessMessage);
cy.closeNotification();
// verify the auto-switching of tab to nurse notes if the user is a nurse
cy.get("#sign-out-button").contains("Sign Out").click();
patientDoctorNotes.signout();
loginPage.loginManuallyAsNurse();
loginPage.ensureLoggedIn();
cy.visit("/patients");
2 changes: 2 additions & 0 deletions cypress/e2e/users_spec/UsersCreation.cy.ts
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ describe("User Creation", () => {

it("Update the existing user profile and verify its reflection", () => {
userCreationPage.clickElementById("user-profile-name");
userCreationPage.clickElementById("profile-button");
userCreationPage.verifyElementContainsText(
"username-profile-details",
"devdistrictadmin",
@@ -129,6 +130,7 @@ describe("User Creation", () => {

it("Update the existing user profile Form Mandatory File Error", () => {
userCreationPage.clickElementById("user-profile-name");
userCreationPage.clickElementById("profile-button");
userCreationPage.clickElementById("edit-cancel-profile-button");
userCreationPage.clearIntoElementById("firstName");
userCreationPage.clearIntoElementById("lastName");
2 changes: 2 additions & 0 deletions cypress/pageobject/Login/LoginPage.ts
Original file line number Diff line number Diff line change
@@ -30,6 +30,8 @@ class LoginPage {
}

ensureLoggedIn(): void {
cy.get("#user-profile-name").click();
cy.get("#sign-out-button").scrollIntoView();
cy.get("#sign-out-button").contains("Sign Out").should("exist");
}
}
4 changes: 2 additions & 2 deletions cypress/pageobject/Patient/PatientDoctorConnect.ts
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@ export class DoctorConnect {
});
}

verifyCopiedContent(text: string) {
cy.get("@clipboardStub").should("be.calledWith", text);
verifyCopiedContent() {
cy.get("@clipboardStub").should("be.calledWithMatch", /^\+91\d{10}$/);
}

verifyIconVisible(selector: string) {
6 changes: 6 additions & 0 deletions cypress/pageobject/Patient/PatientDoctorNotes.ts
Original file line number Diff line number Diff line change
@@ -26,4 +26,10 @@ export class PatientDoctorNotes {
.its("response.statusCode")
.should("eq", 201);
}

signout() {
cy.get("#user-profile-name").click();
cy.get("#sign-out-button").scrollIntoView();
cy.get("#sign-out-button").contains("Sign Out").click();
}
}
1 change: 1 addition & 0 deletions cypress/pageobject/Users/ManageUserPage.ts
Original file line number Diff line number Diff line change
@@ -75,6 +75,7 @@ export class ManageUserPage {
navigateToProfile() {
cy.intercept("GET", "**/api/v1/users/**").as("getUsers");
cy.get("#user-profile-name").click();
cy.get("#profile-button").click();
cy.wait("@getUsers").its("response.statusCode").should("eq", 200);
}

2 changes: 1 addition & 1 deletion src/Components/Common/Sidebar/SidebarUserCard.tsx
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ const SidebarUserCard: React.FC<SidebarUserCardProps> = ({ shrinked }) => {
href="/user/profile"
>
<DropdownMenuItem className="cursor-pointer">
{t("profile")}
<div id="profile-button">{t("profile")}</div>
</DropdownMenuItem>
</Link>
<DropdownMenuItem className="cursor-pointer" onClick={signOut}>