Skip to content

Commit

Permalink
Add a test for the gender icon
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Dec 16, 2024
1 parent 625b610 commit b864aac
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(<PatientBannerPatientInfo patient={mockPatient} />);

expect(screen.getByText('', { selector: 'use[href="#omrs-icon-gender-male"]' })).toBeInTheDocument();

const patientWithUnknownGender = { ...mockPatient, gender: 'unknown' };

render(<PatientBannerPatientInfo patient={patientWithUnknownGender} />);

expect(screen.getByText('', { selector: 'use[href="#omrs-icon-gender-unknown"]' })).toBeInTheDocument();
});
});

0 comments on commit b864aac

Please sign in to comment.