diff --git a/efcms-service/storage/fixtures/efcms.json b/efcms-service/storage/fixtures/efcms.json index f3df4a2408d..42a1e0ed751 100644 --- a/efcms-service/storage/fixtures/efcms.json +++ b/efcms-service/storage/fixtures/efcms.json @@ -90,7 +90,8 @@ "userId": "respondent", "respondentId": "respondent", "email": "testrespondent@example.com", - "token": "respondent" + "token": "respondent", + "barNumber": "IR1228" }, "userId": "taxpayer", "irsSendDate": "2018-12-12T23:32:48.416Z", diff --git a/web-client/src/presenter/computeds/formattedCaseDetail.js b/web-client/src/presenter/computeds/formattedCaseDetail.js index 4c7be57acc4..95d1eb893be 100644 --- a/web-client/src/presenter/computeds/formattedCaseDetail.js +++ b/web-client/src/presenter/computeds/formattedCaseDetail.js @@ -12,7 +12,10 @@ const formatCase = (caseDetail, form) => { const result = _.cloneDeep(caseDetail); if (result.documents) result.documents.map(formatDocument); - + if (result.respondent) + result.respondent.formattedName = `${result.respondent.name} ${ + result.respondent.barNumber + }`; result.createdAtFormatted = moment(result.createdAt).format('L'); result.irsDateFormatted = moment(result.irsDate).format('L LT'); result.payGovDateFormatted = moment(result.payGovDate).format('L'); @@ -29,6 +32,7 @@ const formatCase = (caseDetail, form) => { result.status = result.status === 'general' ? 'general docket' : result.status; + return result; }; diff --git a/web-client/src/tests/computeds.test.js b/web-client/src/tests/computeds.test.js index 8c04a99c0fe..4409f01aa13 100644 --- a/web-client/src/tests/computeds.test.js +++ b/web-client/src/tests/computeds.test.js @@ -27,6 +27,15 @@ describe('formatted case details computed', () => { }); expect(result[0].irsDateFormatted).toContain('11/21/2018'); }); + + it('formats the respondent name to include barnumber', () => { + const result = runCompute(formattedCases, { + state: { + cases: [{ respondent: { name: 'test', barNumber: '123' } }], + }, + }); + expect(result[0].respondent.formattedName).toContain('test 123'); + }); }); describe('formatted search parameters computed', () => { diff --git a/web-client/src/views/PartyInformation.jsx b/web-client/src/views/PartyInformation.jsx index 3c00552e8c2..8f3d2623abd 100644 --- a/web-client/src/views/PartyInformation.jsx +++ b/web-client/src/views/PartyInformation.jsx @@ -5,7 +5,7 @@ import { state } from 'cerebral'; export default connect( { - caseDetail: state.caseDetail, + caseDetail: state.formattedCaseDetail, }, function PartyInformation({ caseDetail }) { return ( @@ -42,7 +42,7 @@ export default connect(

Respondent

-

{caseDetail.respondent.name}

+

{caseDetail.respondent.formattedName}

{caseDetail.respondent.addressLine1}