-
Notifications
You must be signed in to change notification settings - Fork 281
(feat) O3-4465: Enhance patient banner component mocks with comprehensive test support #1489
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
base: main
Are you sure you want to change the base?
(feat) O3-4465: Enhance patient banner component mocks with comprehensive test support #1489
Conversation
… support This commit enhances the mock implementations for Jest and Vitest test frameworks to provide more realistic and testable patient banner components. Key changes: - Enhanced PatientBannerContactDetails with full implementation including address, contact attributes, relationships, and patient lists sections - Enhanced PatientBannerPatientInfo with complete patient demographics rendering including name, gender, age, and birthdate - Enhanced PatientBannerPatientIdentifiers with proper identifier filtering and primary/secondary identifier distinction - Enhanced PatientPhoto with conditional rendering based on loading state and photo availability - Added supporting hooks: usePatient, usePatientContactAttributes, useRelationships, usePatientListsForPatient, usePatientPhoto - Exported formatPartialDate from esm-utils for date formatting - Improved test data attributes for better test assertions These improvements ensure that unit tests can properly validate component behavior and rendering logic without requiring complex custom mocks. Related to: OpenMRS patient banner testing infrastructure
|
@denniskigen can you guide a little on this failing test |
- Updated all @openmrs/* peerDependencies in framework packages from 6.x to 8.x - This resolves dependency version conflicts where packages at v8.0.0 declared incompatible peer deps - Updated yarn.lock to reflect the corrected peer dependency versions
|
@denniskigen @NethmiRodrigo i need some guidance in this failing test i am not able to fix |
|
Hey, @RajPrakash681. The failing attachments-related e2e test in Patient Chart are not related to your diff. Rather, they're caused by a recent regression in the attachments module following the 2.8 migration. @dkayiwa is working on switching it over to use the new storage service, which should fix the regression. |
okay sir thanks for the clarification |
…wait - Use Playwright locator.or() to handle multiple role types (button, menuitem, link) - Add explicit 15s visibility wait before clicking logout - Await globalSetup() in afterEach to prevent race conditions - Eliminates timeout from Job 53969858192
|
@dkayiwa sir any information related to this? |
|
@denniskigen can this be reviewed!? |
This commit enhances the mock implementations for Jest and Vitest test frameworks to provide more realistic and testable patient banner components.
Key changes:
These improvements ensure that unit tests can properly validate component behavior and rendering logic without requiring complex custom mocks.
Related to: OpenMRS patient banner testing infrastructure
Requirements
feat,fix, orchore, among others). See existing PR titles for inspiration.If applicable