Skip to content

Commit

Permalink
Prmdr 397: Incorrect Given name format (#143)
Browse files Browse the repository at this point in the history
* added additional required space in patient summary given name display

---------

Co-authored-by: Scott Alexander <scott.alexander@madetech.com>
  • Loading branch information
SRAlexander and Scott Alexander authored Nov 9, 2023
1 parent b716637 commit 2d87145
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions app/src/components/generic/patientSummary/PatientSummary.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,18 @@ describe('PatientSummary', () => {
expect(screen.getByText(mockDetails.familyName)).toBeInTheDocument();
//expect(screen.getByText(mockDetails.givenName)).toBeInTheDocument()
});

it('renders multiple given names with correct spacing', () => {
const mockDetails = buildPatientDetails({
familyName: 'Jones',
nhsNumber: '0000222000',
givenName: ['Comfort', 'Zulu'],
});

render(<PatientSummary patientDetails={mockDetails} />);

// Using hard coded expected value instead of duplicating the expected logic
const expectedGivenName = 'Comfort Zulu';
expect(screen.getByText(expectedGivenName)).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const PatientSummary = ({ patientDetails }: Props) => {
<SummaryList.Row>
<SummaryList.Key>First name</SummaryList.Key>
<SummaryList.Value id="patient-summary-given-name">
{patientDetails?.givenName?.map((name) => `${name}`)}
{patientDetails?.givenName?.map((name) => `${name} `)}
</SummaryList.Value>
</SummaryList.Row>
<SummaryList.Row>
Expand Down

0 comments on commit 2d87145

Please sign in to comment.