diff --git a/src/applications/claims-status/components/claim-document-request-pages/Automated5103Notice.jsx b/src/applications/claims-status/components/claim-document-request-pages/Automated5103Notice.jsx index ef38e3b6c66a..48656e04c1ad 100644 --- a/src/applications/claims-status/components/claim-document-request-pages/Automated5103Notice.jsx +++ b/src/applications/claims-status/components/claim-document-request-pages/Automated5103Notice.jsx @@ -58,7 +58,7 @@ function Automated5103Notice({ return null; } return ( -
+

5103 Evidence Notice

diff --git a/src/applications/claims-status/components/claim-document-request-pages/DefaultPage.jsx b/src/applications/claims-status/components/claim-document-request-pages/DefaultPage.jsx index 8e6e7d842451..90d6effc2145 100644 --- a/src/applications/claims-status/components/claim-document-request-pages/DefaultPage.jsx +++ b/src/applications/claims-status/components/claim-document-request-pages/DefaultPage.jsx @@ -24,7 +24,7 @@ export default function DefaultPage({ uploading, }) { return ( -
+

Request for {item.displayName}

{item.status === 'NEEDED_FROM_YOU' ? ( diff --git a/src/applications/claims-status/components/claim-status-tab/RecentActivity.jsx b/src/applications/claims-status/components/claim-status-tab/RecentActivity.jsx index d476425b3fab..f88769e93348 100644 --- a/src/applications/claims-status/components/claim-status-tab/RecentActivity.jsx +++ b/src/applications/claims-status/components/claim-status-tab/RecentActivity.jsx @@ -14,6 +14,9 @@ import { export default function RecentActivity({ claim }) { const { TOGGLE_NAMES, useToggleValue } = useFeatureToggle(); + const cst5103UpdateEnabled = useToggleValue( + TOGGLE_NAMES.cst5103UpdateEnabled, + ); const cstClaimPhasesEnabled = useToggleValue(TOGGLE_NAMES.cstClaimPhases); // When feature flag cstClaimPhases is enabled and claim type code is for a disability // compensation claim we show 8 phases instead of 5 with updated description, link text @@ -45,18 +48,29 @@ export default function RecentActivity({ claim }) { } }; + const is5103Notice = item => { + return ( + item.displayName === 'Automated 5103 Notice Response' || + item.displayName === '5103 Notice Response' + ); + }; + const getTrackedItemDescription = item => { + const displayName = + is5103Notice(item) && cst5103UpdateEnabled + ? '5103 Evidence Notice' + : item.displayName; switch (item.status) { case 'NEEDED_FROM_YOU': case 'NEEDED_FROM_OTHERS': - return `We opened a request for "${item.displayName}"`; + return `We opened a request for "${displayName}"`; case 'NO_LONGER_REQUIRED': - return `We closed a request for "${item.displayName}"`; + return `We closed a request for "${displayName}"`; case 'SUBMITTED_AWAITING_REVIEW': - return `We received your document(s) for "${item.displayName}"`; + return `We received your document(s) for "${displayName}"`; case 'INITIAL_REVIEW_COMPLETE': case 'ACCEPTED': - return `We completed a review for "${item.displayName}"`; + return `We completed a review for "${displayName}"`; default: return 'There was an update to this item'; } diff --git a/src/applications/claims-status/tests/components/claim-status-tab/RecentActivity.unit.spec.jsx b/src/applications/claims-status/tests/components/claim-status-tab/RecentActivity.unit.spec.jsx index 0f419212c87f..311d4c782dc3 100644 --- a/src/applications/claims-status/tests/components/claim-status-tab/RecentActivity.unit.spec.jsx +++ b/src/applications/claims-status/tests/components/claim-status-tab/RecentActivity.unit.spec.jsx @@ -8,11 +8,16 @@ import { $ } from '@department-of-veterans-affairs/platform-forms-system/ui'; import RecentActivity from '../../../components/claim-status-tab/RecentActivity'; import { renderWithRouter } from '../../utils'; -const getStore = (cstClaimPhasesEnabled = false) => +const getStore = ( + cstClaimPhasesEnabled = false, + cst5103UpdateEnabled = false, +) => createStore(() => ({ featureToggles: { // eslint-disable-next-line camelcase cst_claim_phases: cstClaimPhasesEnabled, + // eslint-disable-next-line camelcase + cst_5103_update_enabled: cst5103UpdateEnabled, }, })); @@ -322,6 +327,59 @@ const openClaimStep4WithMultipleItems = { }, }; +const openClaimStep4WithAuto5103Notice = { + attributes: { + claimDate: '2024-05-02', + claimPhaseDates: { + phaseChangeDate: '2024-05-22', + currentPhaseBack: false, + latestPhaseType: 'REVIEW_OF_EVIDENCE', + previousPhases: { + phase1CompleteDate: '2024-05-10', + phase2CompleteDate: '2024-05-22', + phase3CompleteDate: '2024-06-07', + }, + }, + claimTypeCode: '110LCMP7IDES', + trackedItems: [ + { + id: 1, + requestedDate: '2024-05-12', + status: 'NEEDED_FROM_YOU', + suspenseDate: '2024-08-07', + displayName: 'Automated 5103 Notice Response', + }, + ], + }, +}; + +const openClaimStep4WithClosed5103Notice = { + attributes: { + claimDate: '2024-05-02', + claimPhaseDates: { + phaseChangeDate: '2024-05-22', + currentPhaseBack: false, + latestPhaseType: 'REVIEW_OF_EVIDENCE', + previousPhases: { + phase1CompleteDate: '2024-05-10', + phase2CompleteDate: '2024-05-22', + phase3CompleteDate: '2024-06-07', + }, + }, + claimTypeCode: '110LCMP7IDES', + trackedItems: [ + { + id: 1, + requestedDate: '2024-05-12', + status: 'NO_LONGER_REQUIRED', + suspenseDate: '2024-08-07', + displayName: '5103 Notice Response', + closedDate: '2024-06-12', + }, + ], + }, +}; + describe('', () => { context('when cstClaimPhasesEnabled enabled', () => { context('when claim doesn’t have trackedItems', () => { @@ -553,6 +611,106 @@ describe('', () => { expect(pagination).to.exist; expect(pagination.pages).to.equal(2); }); + context( + 'when cst5103UpdateEnabled and has an Automated 5103 Notice Response item', + () => { + it('should render list', () => { + const { container, getByText } = renderWithRouter( + + + , + ); + + const recentActivityList = $('ol', container); + expect(recentActivityList).to.exist; + expect( + within(recentActivityList).getAllByRole('listitem').length, + ).to.equal(5); + getByText('We received your claim in our system'); + getByText('Your claim moved into Step 2: Initial review'); + getByText('Your claim moved into Step 3: Evidence gathering'); + getByText('Your claim moved into Step 4: Evidence review'); + getByText('Request for you'); + getByText('We opened a request for "5103 Evidence Notice"'); + expect($('va-pagination', container)).not.to.exist; + }); + }, + ); + context( + 'when cst5103UpdateEnabled disabled and has an Automated 5103 Notice Response item', + () => { + it('should render list', () => { + const { container, getByText } = renderWithRouter( + + + , + ); + + const recentActivityList = $('ol', container); + expect(recentActivityList).to.exist; + expect( + within(recentActivityList).getAllByRole('listitem').length, + ).to.equal(5); + getByText('We received your claim in our system'); + getByText('Your claim moved into Step 2: Initial review'); + getByText('Your claim moved into Step 3: Evidence gathering'); + getByText('Your claim moved into Step 4: Evidence review'); + getByText('Request for you'); + getByText( + 'We opened a request for "Automated 5103 Notice Response"', + ); + expect($('va-pagination', container)).not.to.exist; + }); + }, + ); + context( + 'when cst5103UpdateEnabled and has a closed 5103 Notice Response item', + () => { + it('should render list', () => { + const { container, getByText } = renderWithRouter( + + + , + ); + + const recentActivityList = $('ol', container); + expect(recentActivityList).to.exist; + expect( + within(recentActivityList).getAllByRole('listitem').length, + ).to.equal(5); + getByText('We received your claim in our system'); + getByText('Your claim moved into Step 2: Initial review'); + getByText('Your claim moved into Step 3: Evidence gathering'); + getByText('Your claim moved into Step 4: Evidence review'); + getByText('We closed a request for "5103 Evidence Notice"'); + expect($('va-pagination', container)).not.to.exist; + }); + }, + ); + context( + 'when cst5103UpdateEnabled disabled and has a closed 5103 Notice Response item', + () => { + it('should render list', () => { + const { container, getByText } = renderWithRouter( + + + , + ); + + const recentActivityList = $('ol', container); + expect(recentActivityList).to.exist; + expect( + within(recentActivityList).getAllByRole('listitem').length, + ).to.equal(5); + getByText('We received your claim in our system'); + getByText('Your claim moved into Step 2: Initial review'); + getByText('Your claim moved into Step 3: Evidence gathering'); + getByText('Your claim moved into Step 4: Evidence review'); + getByText('We closed a request for "5103 Notice Response"'); + expect($('va-pagination', container)).not.to.exist; + }); + }, + ); }); }); }); @@ -802,6 +960,110 @@ describe('', () => { expect(pagination).to.exist; expect(pagination.pages).to.equal(2); }); + context( + 'when cst5103UpdateEnabled and has an Automated 5103 Notice Response item', + () => { + it('should render list', () => { + const { container, getByText } = renderWithRouter( + + + , + ); + + const recentActivityList = $('ol', container); + expect(recentActivityList).to.exist; + expect( + within(recentActivityList).getAllByRole('listitem').length, + ).to.equal(4); + getByText('Your claim moved into Step 1: Claim received'); + getByText('Your claim moved into Step 2: Initial review'); + getByText( + 'Your claim moved into Step 3: Evidence gathering, review, and decision', + ); + getByText('Request for you'); + getByText('We opened a request for "5103 Evidence Notice"'); + expect($('va-pagination', container)).not.to.exist; + }); + }, + ); + context( + 'when cst5103UpdateEnabled and has an Automated 5103 Notice Response item', + () => { + it('should render list', () => { + const { container, getByText } = renderWithRouter( + + + , + ); + + const recentActivityList = $('ol', container); + expect(recentActivityList).to.exist; + expect( + within(recentActivityList).getAllByRole('listitem').length, + ).to.equal(4); + getByText('Your claim moved into Step 1: Claim received'); + getByText('Your claim moved into Step 2: Initial review'); + getByText( + 'Your claim moved into Step 3: Evidence gathering, review, and decision', + ); + getByText('Request for you'); + getByText( + 'We opened a request for "Automated 5103 Notice Response"', + ); + expect($('va-pagination', container)).not.to.exist; + }); + }, + ); + context( + 'when cst5103UpdateEnabled and has an Automated 5103 Notice Response item', + () => { + it('should render list', () => { + const { container, getByText } = renderWithRouter( + + + , + ); + + const recentActivityList = $('ol', container); + expect(recentActivityList).to.exist; + expect( + within(recentActivityList).getAllByRole('listitem').length, + ).to.equal(4); + getByText('Your claim moved into Step 1: Claim received'); + getByText('Your claim moved into Step 2: Initial review'); + getByText( + 'Your claim moved into Step 3: Evidence gathering, review, and decision', + ); + getByText('We closed a request for "5103 Evidence Notice"'); + expect($('va-pagination', container)).not.to.exist; + }); + }, + ); + context( + 'when cst5103UpdateEnabled and has an Automated 5103 Notice Response item', + () => { + it('should render list', () => { + const { container, getByText } = renderWithRouter( + + + , + ); + + const recentActivityList = $('ol', container); + expect(recentActivityList).to.exist; + expect( + within(recentActivityList).getAllByRole('listitem').length, + ).to.equal(4); + getByText('Your claim moved into Step 1: Claim received'); + getByText('Your claim moved into Step 2: Initial review'); + getByText( + 'Your claim moved into Step 3: Evidence gathering, review, and decision', + ); + getByText('We closed a request for "5103 Notice Response"'); + expect($('va-pagination', container)).not.to.exist; + }); + }, + ); }); }); });