Testcases ehrs frontend
Overview
What does this MR do and why? This MR improves front‑end reliability by adding targeted unit tests for shared UI building blocks (dropdown menu) and for patient vitals presentation (VitalsByCampSection). These areas are frequently reused across screens, and regressions here would affect navigation and clinical data visibility. The new coverage ensures our UI wrappers behave consistently and that vitals are sorted and styled correctly for clinical review.
Changes Made
- Added comprehensive unit tests for dropdown menu UI primitives to validate rendering, wrappers, and class logic
- Added unit tests for VitalsByCampSection covering empty state, camp metadata, sorting behavior, and status‑based styling
- Verified missing and invalid vitals are displayed safely with neutral UI cues
Technical Details
- Dropdown tests render all exported primitives and validate class application, inset behavior, and sub‑content rendering paths
- Vitals tests validate:
- Most‑recent‑first sorting using
camp_date - Conditional rendering of camp date/location
- Status color classes for BP, RBS, HR, and Pulse (high/low/normal/missing)
- Correct fallback rendering for missing height/weight
- Most‑recent‑first sorting using
- Ensures consistent UI behavior without altering production logic
Type of Change [x] 🧪 Test update
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]