From b864aacd621998a0c3f3b44657507cb0aa043785 Mon Sep 17 00:00:00 2001 From: Dennis Kigen Date: Mon, 16 Dec 2024 21:48:09 +0300 Subject: [PATCH] Add a test for the gender icon --- .../patient-banner-patient-info.test.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/framework/esm-styleguide/src/patient-banner/patient-info/patient-banner-patient-info.test.tsx b/packages/framework/esm-styleguide/src/patient-banner/patient-info/patient-banner-patient-info.test.tsx index 933b6fa59..19dcb540a 100644 --- a/packages/framework/esm-styleguide/src/patient-banner/patient-info/patient-banner-patient-info.test.tsx +++ b/packages/framework/esm-styleguide/src/patient-banner/patient-info/patient-banner-patient-info.test.tsx @@ -74,4 +74,16 @@ describe('PatientBannerPatientInfo', () => { expect(screen.getByText(/national id/i)).toBeInTheDocument(); expect(screen.getByText(/123456789/i)).toBeInTheDocument(); }); + + it('renders the correct gender icon based on patient gender', () => { + render(); + + expect(screen.getByText('', { selector: 'use[href="#omrs-icon-gender-male"]' })).toBeInTheDocument(); + + const patientWithUnknownGender = { ...mockPatient, gender: 'unknown' }; + + render(); + + expect(screen.getByText('', { selector: 'use[href="#omrs-icon-gender-unknown"]' })).toBeInTheDocument(); + }); });