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

Add Cypress Test Suite for Facility Notice Board Functionality Verification #9045

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
66d6ef4
Add Cypress Test Suit to Verify Notify Facility
JavidSumra Nov 7, 2024
1566910
fix addded id in SidebarItemProps type
JavidSumra Nov 7, 2024
dd38cef
fix failing test case
JavidSumra Nov 7, 2024
76dac1e
tying fix in notification test suit
JavidSumra Nov 8, 2024
db8c5ec
test fix for notification test suit
JavidSumra Nov 8, 2024
cbe768d
test fix for notification test suit
JavidSumra Nov 8, 2024
9a1ad6c
Merge branch 'develop' into issues/9041/test-verify-notice-board
JavidSumra Nov 8, 2024
d3d2034
Merge branch 'develop' of github.com:JavidSumra/care_fe into issues/9…
JavidSumra Nov 8, 2024
e6970b7
test fix for Notification test suit
JavidSumra Nov 8, 2024
73d44a1
Merge branch 'issues/9041/test-verify-notice-board' of github.com:Jav…
JavidSumra Nov 8, 2024
b800349
fix Notification Test Suit
JavidSumra Nov 8, 2024
c2069bf
Merge branch 'develop' of github.com:JavidSumra/care_fe into issues/9…
JavidSumra Nov 8, 2024
28d43b0
fix Notification test by verifying url
JavidSumra Nov 8, 2024
87196e3
fix Notification test by verifying url
JavidSumra Nov 8, 2024
1d187b2
trying test fix for Notification test Suit
JavidSumra Nov 8, 2024
b7bed31
trying test fix for Notification test Suit
JavidSumra Nov 8, 2024
4c84e13
Test fix for Notification Board test Suit
JavidSumra Nov 9, 2024
ec37084
fix adding cy function to check visiblity of button
JavidSumra Nov 9, 2024
f196fbe
merge conflict fixed
JavidSumra Nov 9, 2024
958f148
Remove unused functions
JavidSumra Nov 9, 2024
f030749
debug notify button
nihal467 Nov 9, 2024
0fb706c
handle the cache and element focus
nihal467 Nov 9, 2024
7fa0842
fixed the cache
nihal467 Nov 9, 2024
e076c3e
reorder the process to adjust with message delay
nihal467 Nov 9, 2024
461dc91
implement manual reload
nihal467 Nov 10, 2024
9f80448
Merge branch 'develop' into issues/9041/test-verify-notice-board
JavidSumra Nov 10, 2024
07b9d8b
Merge branch 'develop' of github.com:JavidSumra/care_fe into issues/9…
JavidSumra Nov 10, 2024
0690862
Add Changes Made by Nihal
JavidSumra Nov 10, 2024
c306fce
fix merge conflicts
JavidSumra Nov 10, 2024
93924c6
Remove Unused Functions
JavidSumra Nov 10, 2024
edc48d2
Add Network Call Intercept to fix Test Failure Issue
JavidSumra Nov 10, 2024
1ff02f8
added a hard wait to handle celery delay
nihal467 Nov 10, 2024
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
53 changes: 50 additions & 3 deletions cypress/e2e/facility_spec/FacilityHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import FacilityHome from "../../pageobject/Facility/FacilityHome";
import FacilityNotify from "../../pageobject/Facility/FacilityNotify";
import LoginPage from "../../pageobject/Login/LoginPage";
import ManageUserPage from "../../pageobject/Users/ManageUserPage";
import { UserPage } from "../../pageobject/Users/UserSearch";

describe("Facility Homepage Function", () => {
const loginPage = new LoginPage();
const facilityHome = new FacilityHome();
const facilityNotify = new FacilityNotify();
const facilityPage = new FacilityPage();
const manageUserPage = new ManageUserPage();
const userPage = new UserPage();
Expand All @@ -22,6 +24,8 @@ describe("Facility Homepage Function", () => {
const district = "Ernakulam";
const localBody = "Aikaranad";
const facilityType = "Private Hospital";
const notificationErrorMsg = "Message cannot be empty";
const notificationMessage = "Test Notification";
Comment on lines +27 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance test notification message content.

The current test message is too simple and may not catch real-world issues. Consider using a more realistic message that includes:

  1. Dynamic dates (as suggested in past reviews)
  2. Special characters
  3. Multi-line content
  4. Maximum length scenarios
-  const notificationMessage = "Test Notification";
+  const notificationMessage = `Facility Update: Monthly review meeting scheduled for ${Cypress.dayjs().add(7, 'days').format('Do MMM, YYYY')} at 10:00 AM.
+
+Please ensure to:
+- Update patient records
+- Prepare monthly statistics
+- Review inventory status
+
+Contact support@example.com for any queries.`;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const notificationErrorMsg = "Message cannot be empty";
const notificationMessage = "Test Notification";
const notificationErrorMsg = "Message cannot be empty";
const notificationMessage = `Facility Update: Monthly review meeting scheduled for ${Cypress.dayjs().add(7, 'days').format('Do MMM, YYYY')} at 10:00 AM.
Please ensure to:
- Update patient records
- Prepare monthly statistics
- Review inventory status
Contact support@example.com for any queries.`;


before(() => {
loginPage.loginAsDistrictAdmin();
Expand All @@ -30,6 +34,7 @@ describe("Facility Homepage Function", () => {

beforeEach(() => {
cy.restoreLocalStorage();
cy.clearLocalStorage(/filters--.+/);
cy.awaitUrl("/facility");
});

Expand All @@ -41,9 +46,6 @@ describe("Facility Homepage Function", () => {
facilityHome.clickViewCnsButton();
facilityHome.verifyCnsUrl();
facilityHome.navigateBack();
// view notify button
facilityHome.clickFacilityNotifyButton();
facilityHome.verifyAndCloseNotifyModal();
// view facility button
facilityHome.clickViewFacilityDetails();
facilityPage.getFacilityName().should("be.visible");
Expand Down Expand Up @@ -134,6 +136,51 @@ describe("Facility Homepage Function", () => {
facilityHome.verifyLiveMonitorUrl();
});

it("Verify Notice Board Functionality", () => {
// search facility and verify it's loaded or not
manageUserPage.interceptFacilitySearchReq();
manageUserPage.typeFacilitySearch(facilityName);
manageUserPage.verifyFacilitySearchReq();
// verify facility name and card reflection
facilityNotify.verifyUrlContains("Dummy+Facility+40");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid hardcoding URLs in tests.

Using a hardcoded URL "Dummy+Facility+40" makes the test brittle. Instead, encode the facility name dynamically.

-    facilityNotify.verifyUrlContains("Dummy+Facility+40");
+    facilityNotify.verifyUrlContains(encodeURIComponent(facilityName));

Committable suggestion skipped: line range outside the PR's diff.

facilityPage.verifyFacilityBadgeContent(facilityName);
manageUserPage.assertFacilityInCard(facilityName);
// send notification to a facility
facilityHome.clickFacilityNotifyButton();
facilityNotify.verifyFacilityName(facilityName);
facilityNotify.fillNotifyText(notificationMessage);
facilityNotify.interceptPostNotificationReq();
cy.submitButton("Notify");
facilityNotify.verifyPostNotificationReq();
cy.verifyNotification("Facility Notified");
cy.closeNotification();
cy.wait(2000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace hardcoded wait with explicit wait conditions.

Using cy.wait(2000) and manual login verification makes the test flaky. Instead:

  1. Wait for specific elements or state changes
  2. Use Cypress's session management
-    cy.wait(2000);
+    cy.get('[data-testid="notification-popup"]')
+      .should('not.exist');

-    loginPage.ensureLoggedIn();
-    loginPage.clickSignOutBtn();
+    cy.session('nurse', () => {
+      loginPage.loginManuallyAsNurse();
+    });

Also applies to: 180-181

// Verify the frontend error on empty message
facilityHome.clickFacilityNotifyButton();
facilityNotify.verifyFacilityName(facilityName);
cy.submitButton("Notify");
facilityNotify.verifyErrorMessage(notificationErrorMsg);
// close pop-up and verify
facilityHome.verifyAndCloseNotifyModal();
// signout as district admin and login as a Nurse
loginPage.ensureLoggedIn();
loginPage.clickSignOutBtn();
loginPage.loginManuallyAsNurse();
// Verify Notice Board Reflection
facilityNotify.interceptGetNotificationReq("MESSAGE");
facilityNotify.visitNoticeBoard();
facilityNotify.verifyGetNotificationReq();
facilityNotify.verifyFacilityNoticeBoardMessage(notificationMessage);
facilityNotify.interceptGetNotificationReq();
// Verify Sidebar Notification Reflection
facilityNotify.openNotificationSlide();
facilityNotify.verifyGetNotificationReq();
cy.verifyContentPresence("#notification-slide-msg", [notificationMessage]);
Comment on lines +173 to +178
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add explicit wait conditions for notification visibility.

The notification checks might be flaky without proper wait conditions.

-    facilityNotify.verifyFacilityNoticeBoardMessage(notificationMessage);
+    cy.get('#notification-message')
+      .should('be.visible')
+      .and('contain.text', notificationMessage);

     facilityNotify.interceptGetNotificationReq();
     facilityNotify.openNotificationSlide();
     facilityNotify.verifyGetNotificationReq();
-    cy.verifyContentPresence("#notification-slide-msg", [notificationMessage]);
+    cy.get("#notification-slide-msg")
+      .should('be.visible')
+      .and('contain.text', notificationMessage);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
facilityNotify.verifyFacilityNoticeBoardMessage(notificationMessage);
facilityNotify.interceptGetNotificationReq();
// Verify Sidebar Notification Reflection
facilityNotify.openNotificationSlide();
facilityNotify.verifyGetNotificationReq();
cy.verifyContentPresence("#notification-slide-msg", [notificationMessage]);
cy.get('#notification-message')
.should('be.visible')
.and('contain.text', notificationMessage);
facilityNotify.interceptGetNotificationReq();
facilityNotify.openNotificationSlide();
facilityNotify.verifyGetNotificationReq();
cy.get("#notification-slide-msg")
.should('be.visible')
.and('contain.text', notificationMessage);

facilityNotify.closeNotificationSlide();
loginPage.ensureLoggedIn();
loginPage.clickSignOutBtn();
});
Comment on lines +139 to +182
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Test case needs to be split into smaller, focused tests.

The current test case is doing too much and violates the Single Responsibility Principle. It should be split into smaller, focused tests following the AAA (Arrange-Act-Assert) pattern.

Split into these focused test cases:

describe('Notice Board Functionality', () => {
  beforeEach(() => {
    cy.restoreLocalStorage();
    // Common setup
    manageUserPage.interceptFacilitySearchReq();
    manageUserPage.typeFacilitySearch(facilityName);
    manageUserPage.verifyFacilitySearchReq();
  });

  it('should validate empty notification message', () => {
    facilityHome.clickFacilityNotifyButton();
    cy.submitButton("Notify");
    facilityNotify.verifyErrorMessage(notificationErrorMsg);
  });

  it('should successfully send notification as district admin', () => {
    facilityHome.clickFacilityNotifyButton();
    facilityNotify.fillNotifyText(notificationMessage);
    facilityNotify.interceptPostNotificationReq();
    cy.submitButton("Notify");
    facilityNotify.verifyPostNotificationReq();
    cy.verifyNotification("Facility Notified");
  });

  it('should display notification to nurse', () => {
    loginPage.loginManuallyAsNurse();
    facilityNotify.interceptGetNotificationReq();
    facilityNotify.visitNoticeBoard();
    facilityNotify.verifyGetNotificationReq();
    cy.verifyContentPresence("#notification-message", [notificationMessage]);
    facilityNotify.openNotificationSlide();
    cy.verifyContentPresence("#notification-slide-msg", [notificationMessage]);
  });
});

🛠️ Refactor suggestion

Add error handling test cases.

The test suite lacks error scenarios that could occur in production.

Add these test cases:

it('should handle network failure when sending notification', () => {
  facilityHome.clickFacilityNotifyButton();
  facilityNotify.fillNotifyText(notificationMessage);
  
  cy.intercept('POST', '**/api/v1/notification/notify', {
    forceNetworkError: true
  }).as('networkError');
  
  cy.submitButton("Notify");
  cy.wait('@networkError');
  cy.verifyNotification("Failed to send notification");
});

it('should handle server error when sending notification', () => {
  facilityHome.clickFacilityNotifyButton();
  facilityNotify.fillNotifyText(notificationMessage);
  
  cy.intercept('POST', '**/api/v1/notification/notify', {
    statusCode: 500,
    body: { error: 'Internal Server Error' }
  }).as('serverError');
  
  cy.submitButton("Notify");
  cy.wait('@serverError');
  cy.verifyNotification("Server error occurred");
});

🛠️ Refactor suggestion

Add cleanup in afterEach hook.

The test modifies application state but doesn't clean up afterwards.

  afterEach(() => {
    cy.saveLocalStorage();
+    // Clean up notifications created during tests
+    if (cy.state('test').title.includes('Notice Board')) {
+      facilityNotify.interceptDeleteNotificationReq();
+      facilityNotify.deleteAllNotifications();
+      facilityNotify.verifyDeleteNotificationReq();
+    }
  });

Committable suggestion skipped: line range outside the PR's diff.


afterEach(() => {
cy.saveLocalStorage();
});
Expand Down
3 changes: 2 additions & 1 deletion cypress/pageobject/Facility/FacilityHome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class FacilityHome {
}

clickFacilityNotifyButton() {
cy.get("#facility-notify").first().click();
cy.get("#facility-notify", { timeout: 10000 }).should("be.visible");
cy.get("#facility-notify").focus().click();
}

clickLiveMonitorButton() {
Expand Down
58 changes: 58 additions & 0 deletions cypress/pageobject/Facility/FacilityNotify.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
export default class FacilityNotify {
verifyFacilityName(facilityName: string) {
cy.verifyContentPresence("#notify-facility-name", [facilityName]);
}

verifyErrorMessage(errorMessage: string) {
cy.verifyContentPresence(".error-text", [errorMessage]);
}
Comment on lines +2 to +8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance UI verification methods with better TypeScript and error handling.

The verification methods could be more robust with proper type annotations and error handling.

-  verifyFacilityName(facilityName: string) {
+  verifyFacilityName(facilityName: string): void {
     cy.verifyContentPresence("#notify-facility-name", [facilityName])
+      .then($elements => {
+        if ($elements.length === 0) {
+          throw new Error(`Facility name "${facilityName}" not found in the DOM`);
+        }
+      });
   }

-  verifyErrorMessage(errorMessage: string) {
+  verifyErrorMessage(errorMessage: string): void {
     cy.verifyContentPresence(".error-text", [errorMessage])
+      .then($elements => {
+        if ($elements.length === 0) {
+          throw new Error(`Error message "${errorMessage}" not found in the DOM`);
+        }
+      });
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
verifyFacilityName(facilityName: string) {
cy.verifyContentPresence("#notify-facility-name", [facilityName]);
}
verifyErrorMessage(errorMessage: string) {
cy.verifyContentPresence(".error-text", [errorMessage]);
}
verifyFacilityName(facilityName: string): void {
cy.verifyContentPresence("#notify-facility-name", [facilityName])
.then($elements => {
if ($elements.length === 0) {
throw new Error(`Facility name "${facilityName}" not found in the DOM`);
}
});
}
verifyErrorMessage(errorMessage: string): void {
cy.verifyContentPresence(".error-text", [errorMessage])
.then($elements => {
if ($elements.length === 0) {
throw new Error(`Error message "${errorMessage}" not found in the DOM`);
}
});
}


fillNotifyText(message: string) {
cy.get("#NotifyModalMessageInput").scrollIntoView();
cy.get("#NotifyModalMessageInput").click().type(message);
}
Comment on lines +10 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Optimize notification text input method.

The method has duplicate cy.get calls which is inefficient and could lead to flaky tests.

-  fillNotifyText(message: string) {
+  fillNotifyText(message: string): void {
-    cy.get("#NotifyModalMessageInput").scrollIntoView();
-    cy.get("#NotifyModalMessageInput").click().type(message);
+    cy.get("#NotifyModalMessageInput")
+      .scrollIntoView()
+      .should('be.visible')
+      .click()
+      .clear()
+      .type(message, { delay: 50 })
+      .should('have.value', message);
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fillNotifyText(message: string) {
cy.get("#NotifyModalMessageInput").scrollIntoView();
cy.get("#NotifyModalMessageInput").click().type(message);
}
fillNotifyText(message: string): void {
cy.get("#NotifyModalMessageInput")
.scrollIntoView()
.should('be.visible')
.click()
.clear()
.type(message, { delay: 50 })
.should('have.value', message);
}


verifyFacilityNoticeBoardMessage(message: string) {
cy.get("#notification-message", { timeout: 10000 }).should("be.visible");
cy.verifyContentPresence("#notification-message", [message]);
}
Comment on lines +15 to +18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add retry and error handling for notification message verification.

The message verification could be more robust with proper error handling and retry logic.

   verifyFacilityNoticeBoardMessage(message: string): void {
-    cy.get("#notification-message", { timeout: 10000 }).should("be.visible");
-    cy.verifyContentPresence("#notification-message", [message]);
+    cy.get("#notification-message", { timeout: 10000 })
+      .should("be.visible")
+      .then($el => {
+        if (!$el.length) {
+          throw new Error('Notification message element not found');
+        }
+        cy.wrap($el)
+          .invoke('text')
+          .should('include', message, {
+            retry: {
+              tries: 3,
+              delay: 1000
+            }
+          });
+      });
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
verifyFacilityNoticeBoardMessage(message: string) {
cy.get("#notification-message", { timeout: 10000 }).should("be.visible");
cy.verifyContentPresence("#notification-message", [message]);
}
verifyFacilityNoticeBoardMessage(message: string) {
cy.get("#notification-message", { timeout: 10000 })
.should("be.visible")
.then($el => {
if (!$el.length) {
throw new Error('Notification message element not found');
}
cy.wrap($el)
.invoke('text')
.should('include', message, {
retry: {
tries: 3,
delay: 1000
}
});
});
}


openNotificationSlide() {
cy.get("#notification-slide-btn").should("be.visible").click();
}

closeNotificationSlide() {
cy.get("#close-slide-over").should("be.visible").click();
}

visitNoticeBoard() {
cy.get("a[href='/notice_board']").should("be.visible").click();
}

visitNotificationSideBar() {
cy.get("#notification-slide-btn").should("be.visible").click();
}

verifyUrlContains(substring: string) {
cy.url().should("include", substring);
}

interceptPostNotificationReq() {
cy.intercept("POST", "**/api/v1/notification/notify").as("notifyFacility");
}

verifyPostNotificationReq() {
cy.wait("@notifyFacility").its("response.statusCode").should("eq", 204);
}

interceptGetNotificationReq(event: string = "") {
cy.intercept(
"GET",
`**/api/v1/notification/?offset=0&event=${event}&*=SYSTEM`,
).as("getNotifications");
}

verifyGetNotificationReq() {
cy.wait("@getNotifications").its("response.statusCode").should("eq", 200);
}
}
4 changes: 4 additions & 0 deletions cypress/pageobject/Login/LoginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class LoginPage {
cy.get("#sign-out-button").scrollIntoView();
cy.get("#sign-out-button").contains("Sign Out").should("exist");
}

clickSignOutBtn(): void {
cy.verifyAndClickElement("#sign-out-button", "Sign Out");
}
}

export default LoginPage;
8 changes: 8 additions & 0 deletions cypress/pageobject/Users/ManageUserPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ export class ManageUserPage {
cy.get("#search").click().type(facilityName);
}

interceptFacilitySearchReq() {
cy.intercept("GET", "**/api/v1/facility/**").as("searchFacility");
}

verifyFacilitySearchReq() {
cy.wait("@searchFacility").its("response.statusCode").should("eq", 200);
}
Comment on lines +106 to +108
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider enhancing error handling for API verification.

While the status code check is good, we should also verify the response structure to ensure data integrity.

Consider this enhancement:

  verifyFacilitySearchReq() {
-   cy.wait("@searchFacility").its("response.statusCode").should("eq", 200);
+   cy.wait("@searchFacility").then((interception) => {
+     expect(interception.response?.statusCode).to.eq(200);
+     expect(interception.response?.body).to.have.property("data");
+     // Add more specific response body checks based on API contract
+   });
  }

Committable suggestion skipped: line range outside the PR's diff.


assertFacilityInCard(facilityName: string) {
cy.get("#facility-name-card").should("contain", facilityName);
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Common/Sidebar/SidebarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import useAppHistory from "@/hooks/useAppHistory";
export type SidebarIcon = React.ReactNode;

type SidebarItemProps = {
id?: string;
ref?: React.Ref<HTMLAnchorElement>;
text: string;
icon: SidebarIcon;
Expand All @@ -31,6 +32,7 @@ const SidebarItemBase = forwardRef<HTMLAnchorElement, SidebarItemBaseProps>(
return (
<Link
ref={ref}
id={props?.id}
className={`tooltip relative ml-1 mr-2 h-12 flex-1 cursor-pointer rounded-md py-1 font-medium text-gray-600 transition md:flex-none ${
props.selected
? "bg-white text-green-800 shadow"
Expand Down
5 changes: 4 additions & 1 deletion src/components/Facility/FacilityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ export const FacilityCard = (props: {
<DialogModal
show={notifyModalFor === facility.id}
title={
<span className="flex justify-center text-2xl">
<span
className="flex justify-center text-2xl"
id="notify-facility-name"
>
Notify: {facility.name}
</span>
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/Notifications/NoticeBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export const NoticeBoard = () => {
className="overflow-hidden rounded shadow-md"
>
<div className="px-6 py-4">
<div className="text-justify text-lg">{item.message}</div>
<div className="text-justify text-lg" id="notification-message">
{item.message}
</div>
<div className="text-md my-2 text-secondary-700">
{formatName(item.caused_by)} -{" "}
<span className="font-bold text-primary-700">
Expand Down
5 changes: 4 additions & 1 deletion src/components/Notifications/NotificationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ const NotificationTile = ({
/>
</div>
</div>
<div className="py-1 text-sm">{result.message}</div>
<div className="py-1 text-sm" id="notification-slide-msg">
{result.message}
</div>
<div className="flex flex-col justify-end gap-2">
<div className="py-1 text-right text-xs text-secondary-700">
{formatDateTime(result.created_date)}
Expand Down Expand Up @@ -474,6 +476,7 @@ export default function NotificationsList({
<>
<Item
text={t("Notifications")}
id="notification-slide-btn"
do={() => setOpen(!open)}
icon={<CareIcon icon="l-bell" className="h-5" />}
badgeCount={unreadCount}
Expand Down
Loading