Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucy Jemutai authored and Lucy Jemutai committed Nov 28, 2024
1 parent 3727c77 commit e2c7b30
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jest.mock('./patientHivStatus', () => ({

describe('PatientStatusBannerTag', () => {
const hivPositiveSampleUuid = '138571AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
const patientUuid = '22ab3fdb-1510-4675-85aa-f180064de450';

beforeEach(() => {
jest.clearAllMocks();
Expand Down Expand Up @@ -47,4 +48,30 @@ describe('PatientStatusBannerTag', () => {
render(<PatientStatusBannerTag patientUuid={hivPositiveSampleUuid} />);
expect(screen.getByText('HIV Negative')).toBeInTheDocument();
});

it('should display the correct outcome tag', () => {
render(<PatientStatusBannerTag patientUuid="patientUuid" mappedOutcome="Dead" outcomeTagColor="red" />);
expect(screen.getByText('Dead')).toBeInTheDocument();
});

it('should display the mother tag', () => {
render(<PatientStatusBannerTag patientUuid="patientUuid" motherName="Jane Doe" />);
expect(screen.getByText('Mother: Jane Doe')).toBeInTheDocument();
});

it('should not display children tag if childrenNames is empty', () => {
render(<PatientStatusBannerTag patientUuid={patientUuid} patientGender="F" childrenNames={[]} />);
expect(screen.queryByText('Children:')).toBeNull();
});

it('should display children tag for female patients', () => {
render(
<PatientStatusBannerTag
patientUuid={patientUuid}
patientGender="F"
childrenNames={['Mark obadi', 'Grace Obadi']}
/>,
);
expect(screen.getByText('Children: Mark obadi || Grace Obadi')).toBeInTheDocument();
});
});

0 comments on commit e2c7b30

Please sign in to comment.