Skip to content

Commit

Permalink
Merge pull request #5497 from hmcts/DTSCCI-1486
Browse files Browse the repository at this point in the history
DTSCCI-1486 fix timeline and evidence for full defence.
  • Loading branch information
anirudha-deshpande authored Feb 10, 2025
2 parents 5c9d950 + e66fe5b commit abb2bf5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/common/models/evidence/evidenceType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ export function convertToEvidenceTypeToTranslationKey(type: EvidenceType): strin
case EvidenceType.STATEMENT_OF_ACCOUNT:
return 'PAGES.CHECK_YOUR_ANSWER.EVIDENCE_STATEMENT_OF_ACCOUNT';
case EvidenceType.OTHER:
return 'PAGES.CHECK_YOUR_ANSWER.VIDENCE_OTHER';
return 'PAGES.CHECK_YOUR_ANSWER.EVIDENCE_OTHER';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ import {convertToEvidenceTypeToTranslationKey} from 'common/models/evidence/evid

const changeLabel = (lang: string ): string => t('COMMON.BUTTONS.CHANGE', {lng: getLng(lang)});

const addTimeline = (claim: Claim, claimId: string, lang: string , section: SummarySection) => {
const addTimeline = (claimId: string, lang: string , section: SummarySection, timeline: DefendantTimeline = new DefendantTimeline([], '')) => {
const yourTimelineHref = constructResponseUrlWithIdParams(claimId, CITIZEN_TIMELINE_URL);
const timeline = claim.partialAdmission?.timeline ? claim.partialAdmission.timeline : new DefendantTimeline([], '');

section.summaryList.rows.push(
summaryRow(t('PAGES.CHECK_YOUR_ANSWER.TIMELINE_TITLE', {lng: getLng(lang)}), '', yourTimelineHref, changeLabel(lang)),
Expand Down Expand Up @@ -116,15 +115,13 @@ export const buildYourResponseDetailsSection = (claim: Claim, claimId: string, l
switch (claim.respondent1.responseType) {
case ResponseType.PART_ADMISSION:
getSummaryRowsForPartAdmission(claim, claimId, lang, yourResponseDetailsSection);
addTimeline(claim, claimId, lang, yourResponseDetailsSection);
addTimeline(claimId, lang, yourResponseDetailsSection, claim.partialAdmission.timeline);
addEvidence(claim, claimId, lang, yourResponseDetailsSection);
break;
case ResponseType.FULL_DEFENCE:
getSummaryRowsForFullReject(claim, claimId, lang, yourResponseDetailsSection);
if (isPaidAmountEqulGreaterThanTotalAmount(claim)) {
addTimeline(claim, claimId, lang, yourResponseDetailsSection);
addEvidence(claim, claimId, lang, yourResponseDetailsSection);
}
addTimeline(claimId, lang, yourResponseDetailsSection, claim.rejectAllOfClaim.timeline);
addEvidence(claim, claimId, lang, yourResponseDetailsSection);
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ describe('Partial Admit - Response Details', () => {
expect(summarySections.sections[constVal.INDEX_RESPONSE_DETAILS_SECTION].summaryList.rows[14].actions?.items[0].href).toBe(CITIZEN_EVIDENCE_URL.replace(':id', constVal.CLAIM_ID));
expect(summarySections.sections[constVal.INDEX_RESPONSE_DETAILS_SECTION].summaryList.rows[14].actions?.items[0].text).toBe(constVal.PAGES_CHECK_YOUR_ANSWER_CHANGE);

expect(summarySections.sections[constVal.INDEX_RESPONSE_DETAILS_SECTION].summaryList.rows[15].key.text).toBe('PAGES.CHECK_YOUR_ANSWER.VIDENCE_OTHER');
expect(summarySections.sections[constVal.INDEX_RESPONSE_DETAILS_SECTION].summaryList.rows[15].key.text).toBe('PAGES.CHECK_YOUR_ANSWER.EVIDENCE_OTHER');
expect(summarySections.sections[constVal.INDEX_RESPONSE_DETAILS_SECTION].summaryList.rows[15].value.html).toBe('Evidence details 8');
expect(summarySections.sections[constVal.INDEX_RESPONSE_DETAILS_SECTION].summaryList.rows[15].actions?.items[0].href).toBe(CITIZEN_EVIDENCE_URL.replace(':id', constVal.CLAIM_ID));
expect(summarySections.sections[constVal.INDEX_RESPONSE_DETAILS_SECTION].summaryList.rows[15].actions?.items[0].text).toBe(constVal.PAGES_CHECK_YOUR_ANSWER_CHANGE);
Expand Down

0 comments on commit abb2bf5

Please sign in to comment.