diff --git a/VAMobile/e2e/tests/Claims.e2e.ts b/VAMobile/e2e/tests/Claims.e2e.ts index 7c3eacb2448..4b64a1c58b7 100644 --- a/VAMobile/e2e/tests/Claims.e2e.ts +++ b/VAMobile/e2e/tests/Claims.e2e.ts @@ -25,19 +25,19 @@ export const ClaimsE2eIdConstants = { 'Dependency Received January 01, 2016 Step 4 of 5: Preparation for notification Moved to this step on July 30, 2016', CLOSED_CLAIM_DECISION_LETTER_ID: 'Compensation Decision letter ready Received January 01, 2021 Step 5 of 5: Complete Moved to this step on April 09, 2021', - CLAIM_3_STATUS_STEP_1_ID: 'Step 1. Claim received. Complete.', - CLAIM_3_STATUS_STEP_2_ID: 'Step 2. Initial review. Current step. Step 1 complete.', - CLAIM_3_STATUS_STEP_3_ID: 'Step 3. Evidence gathering, review, and decision. Incomplete.', - CLAIM_3_STATUS_STEP_4_ID: 'Step 4. Preparation for notification. Incomplete.', - CLAIM_3_STATUS_STEP_5_ID: 'Step 5. Complete. Incomplete.', - CLAIM_4_STATUS_STEP_1_ID: 'Step 1. Claim received. Complete.', - CLAIM_4_STATUS_STEP_2_ID: 'Step 2. Initial review. Complete.', - CLAIM_4_STATUS_STEP_3_ID: 'Step 3. Evidence gathering. Current step. Step 1 through 2 complete.', - CLAIM_4_STATUS_STEP_4_ID: 'Step 4. Evidence review. Incomplete.', - CLAIM_4_STATUS_STEP_5_ID: 'Step 5. Rating. Incomplete.', - CLAIM_4_STATUS_STEP_6_ID: 'Step 6. Preparing decision letter. Incomplete.', - CLAIM_4_STATUS_STEP_7_ID: 'Step 7. Final review. Incomplete.', - CLAIM_4_STATUS_STEP_8_ID: 'Step 8. Claim decided. Incomplete.', + CLAIM_3_STATUS_STEP_1_ID: 'Step 1 of 5. Claim received. Complete.', + CLAIM_3_STATUS_STEP_2_ID: 'Step 2 of 5. Initial review. Current step. Step 1 complete.', + CLAIM_3_STATUS_STEP_3_ID: 'Step 3 of 5. Evidence gathering, review, and decision. Incomplete.', + CLAIM_3_STATUS_STEP_4_ID: 'Step 4 of 5. Preparation for notification. Incomplete.', + CLAIM_3_STATUS_STEP_5_ID: 'Step 5 of 5. Complete. Incomplete.', + CLAIM_4_STATUS_STEP_1_ID: 'Step 1 of 8. Claim received. Complete.', + CLAIM_4_STATUS_STEP_2_ID: 'Step 2 of 8. Initial review. Complete.', + CLAIM_4_STATUS_STEP_3_ID: 'Step 3 of 8. Evidence gathering. Current step. Step 1 through 2 complete.', + CLAIM_4_STATUS_STEP_4_ID: 'Step 4 of 8. Evidence review. Incomplete.', + CLAIM_4_STATUS_STEP_5_ID: 'Step 5 of 8. Rating. Incomplete.', + CLAIM_4_STATUS_STEP_6_ID: 'Step 6 of 8. Preparing decision letter. Incomplete.', + CLAIM_4_STATUS_STEP_7_ID: 'Step 7 of 8. Final review. Incomplete.', + CLAIM_4_STATUS_STEP_8_ID: 'Step 8 of 8. Claim decided. Incomplete.', GET_CLAIMS_LETTER_BUTTON_ID: 'getClaimLettersTestID', FILE_REQUEST_BUTTON_ID: 'Step3FileRequestButton', CURRENT_STEP_TEXT: 'Current step', @@ -209,7 +209,7 @@ describe(':ios: Claims Screen', () => { await element(by.text(CommonE2eIdConstants.CLAIMS_HISTORY_BUTTON_TEXT)).tap() await element(by.id('claimsHistoryID')).scrollTo('top') await element(by.id(ClaimsE2eIdConstants.CLAIM_1_ID)).tap() - await expect(element(by.id('Step 1. Claim received. Current step.'))).toExist() + await expect(element(by.id('Step 1 of 5. Claim received. Current step.'))).toExist() await expect(element(by.text(ClaimsE2eIdConstants.CURRENT_STEP_TEXT))).toExist() await expect(element(by.text('Thank you. VA received your claim'))).toExist() await element(by.text(CommonE2eIdConstants.CLAIMS_HISTORY_BUTTON_TEXT)).tap() @@ -217,7 +217,7 @@ describe(':ios: Claims Screen', () => { it('should verify details of claim on step 2', async () => { await element(by.id(ClaimsE2eIdConstants.CLAIM_3_ID)).tap() - await expect(element(by.id('Step 2. Initial review. Current step. Step 1 complete.'))).toExist() + await expect(element(by.id('Step 2 of 5. Initial review. Current step. Step 1 complete.'))).toExist() await expect( element( by.text('Your claim has been assigned to a reviewer who is determining if additional information is needed.'), @@ -309,16 +309,16 @@ describe(':ios: Claims Screen', () => { await element(by.id(ClaimsE2eIdConstants.CLAIM_5_ID)).tap() await setTimeout(2000) await expect( - element(by.id('Step 3. Evidence gathering, review, and decision. Current step. Step 1 through 2 complete.')), + element(by.id('Step 3 of 5. Evidence gathering, review, and decision. Current step. Step 1 through 2 complete.')), ).toExist() await waitFor( - element(by.id('Step 3. Evidence gathering, review, and decision. Current step. Step 1 through 2 complete.')), + element(by.id('Step 3 of 5. Evidence gathering, review, and decision. Current step. Step 1 through 2 complete.')), ) .toBeVisible() .whileElement(by.id(ClaimsE2eIdConstants.CLAIMS_DETAILS_SCREEN_ID)) .scroll(100, 'down') await element( - by.id('Step 3. Evidence gathering, review, and decision. Current step. Step 1 through 2 complete.'), + by.id('Step 3 of 5. Evidence gathering, review, and decision. Current step. Step 1 through 2 complete.'), ).tap() await expect( element( @@ -337,7 +337,7 @@ describe(':ios: Claims Screen', () => { .scroll(100, 'down') await element(by.id(ClaimsE2eIdConstants.CLAIM_6_ID)).tap() await expect( - element(by.id('Step 4. Preparation for notification. Current step. Step 1 through 3 complete.')), + element(by.id('Step 4 of 5. Preparation for notification. Current step. Step 1 through 3 complete.')), ).toExist() await expect(element(by.text('We are preparing your claim decision packet to be mailed.'))).toExist() await element(by.text(CommonE2eIdConstants.CLAIMS_HISTORY_BUTTON_TEXT)).tap() @@ -347,7 +347,7 @@ describe(':ios: Claims Screen', () => { await element(by.id(ClaimsE2eIdConstants.CLAIMS_HISTORY_SCREEN_ID)).scrollTo('top') await element(by.id(ClaimsE2eIdConstants.CLAIM_2_ID)).tap() await element(by.id(ClaimsE2eIdConstants.CLAIMS_DETAILS_SCREEN_ID)).scrollTo('bottom') - await element(by.id('Step 5. Complete. Complete.')).tap() + await element(by.id('Step 5 of 5. Complete. Complete.')).tap() await expect(element(by.text('Complete')).atIndex(1)).toExist() await element(by.text(CommonE2eIdConstants.CLAIMS_HISTORY_BUTTON_TEXT)).tap() }) diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimStatus.test.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimStatus.test.tsx index 11de152fec5..273553ccf5d 100644 --- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimStatus.test.tsx +++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimStatus.test.tsx @@ -40,14 +40,16 @@ context('ClaimStatus', () => { }) it('Renders ClaimStatus', () => { - expect(screen.getByLabelText('Step 1. Claim received. Complete.')).toBeTruthy() - expect(screen.getByLabelText('Step 2. Initial review. Complete.')).toBeTruthy() - expect(screen.getByLabelText('Step 3. Evidence gathering. Current step. Step 1 through 2 complete.')).toBeTruthy() - expect(screen.getByLabelText('Step 4. Evidence review. Incomplete.')).toBeTruthy() - expect(screen.getByLabelText('Step 5. Rating. Incomplete.')).toBeTruthy() - expect(screen.getByLabelText('Step 6. Preparing decision letter. Incomplete.')).toBeTruthy() - expect(screen.getByLabelText('Step 7. Final review. Incomplete.')).toBeTruthy() - expect(screen.getByLabelText('Step 8. Claim decided. Incomplete.')).toBeTruthy() + expect(screen.getByLabelText('Step 1 of 8. Claim received. Complete.')).toBeTruthy() + expect(screen.getByLabelText('Step 2 of 8. Initial review. Complete.')).toBeTruthy() + expect( + screen.getByLabelText('Step 3 of 8. Evidence gathering. Current step. Step 1 through 2 complete.'), + ).toBeTruthy() + expect(screen.getByLabelText('Step 4 of 8. Evidence review. Incomplete.')).toBeTruthy() + expect(screen.getByLabelText('Step 5 of 8. Rating. Incomplete.')).toBeTruthy() + expect(screen.getByLabelText('Step 6 of 8. Preparing decision letter. Incomplete.')).toBeTruthy() + expect(screen.getByLabelText('Step 7 of 8. Final review. Incomplete.')).toBeTruthy() + expect(screen.getByLabelText('Step 8 of 8. Claim decided. Incomplete.')).toBeTruthy() }) describe('when the claimType is CLOSED', () => { diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimPhase.test.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimPhase.test.tsx index 20327727cee..d95c4e4e2c6 100644 --- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimPhase.test.tsx +++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimPhase.test.tsx @@ -22,10 +22,11 @@ jest.mock('utils/remoteConfig') when(featureEnabled).calledWith('claimPhaseExpansion').mockReturnValue(true) context('ClaimPhase', () => { - const initializeTestInstance = (phase: number, current: number) => { + const initializeTestInstance = (phase: number, current: number, isDisabilityClaim: boolean) => { + const claimTypeCode = isDisabilityClaim ? '010LCOMP' : '290AUTOIDES' const props: ClaimPhaseProps = { phase, - attributes: { ...claim.attributes, phase: current }, + attributes: { ...claim.attributes, phase: current, claimTypeCode }, claimID: claim.id, scrollIsEnabled: false, scrollViewRef: {} as RefObject, @@ -34,16 +35,16 @@ context('ClaimPhase', () => { render() } - it('initializes correctly', () => { - initializeTestInstance(1, 1) - expect(screen.getByLabelText('Step 1. Claim received. Current step.')).toBeTruthy() + it('initializes 5-step claim correctly', () => { + initializeTestInstance(1, 1, false) + expect(screen.getByLabelText('Step 1 of 5. Claim received. Current step.')).toBeTruthy() expect(screen.getByRole('tab')).toBeTruthy() }) describe('when phase is less than current', () => { it('renders correct label and text after press', () => { - initializeTestInstance(1, 2) - expect(screen.getByLabelText('Step 1. Claim received. Complete.')).toBeTruthy() + initializeTestInstance(1, 2, true) + expect(screen.getByLabelText('Step 1 of 8. Claim received. Complete.')).toBeTruthy() fireEvent.press(screen.getAllByRole('tab')[0]) expect(screen.getByText('We received your claim in our system.')).toBeTruthy() }) @@ -51,8 +52,8 @@ context('ClaimPhase', () => { describe('when phase is equal to current', () => { it('renders correct label and text without press', () => { - initializeTestInstance(2, 2) - expect(screen.getByLabelText('Step 2. Initial review. Current step. Step 1 complete.')).toBeTruthy() + initializeTestInstance(2, 2, true) + expect(screen.getByLabelText('Step 2 of 8. Initial review. Current step. Step 1 complete.')).toBeTruthy() expect( screen.getByText( "We'll check your claim for basic information we need, like your name and Social Security number.\n\nIf information is missing, we'll contact you.", @@ -63,9 +64,9 @@ context('ClaimPhase', () => { describe('when phase is equal to current with multiple steps complete', () => { it('renders correct label and text without press', () => { - initializeTestInstance(6, 6) + initializeTestInstance(6, 6, true) expect( - screen.getByLabelText('Step 6. Preparing decision letter. Current step. Step 1 through 5 complete.'), + screen.getByLabelText('Step 6 of 8. Preparing decision letter. Current step. Step 1 through 5 complete.'), ).toBeTruthy() expect( screen.getByText( @@ -77,8 +78,8 @@ context('ClaimPhase', () => { describe('when phase is greater than current', () => { it('renders correct label and text after press', () => { - initializeTestInstance(8, 7) - expect(screen.getByLabelText('Step 8. Claim decided. Incomplete.')).toBeTruthy() + initializeTestInstance(8, 7, true) + expect(screen.getByLabelText('Step 8 of 8. Claim decided. Incomplete.')).toBeTruthy() fireEvent.press(screen.getAllByRole('tab')[0]) expect( screen.getByText("You’ll be able to view and download your decision letter. We'll also mail you this letter."), diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimPhase.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimPhase.tsx index 74b529b6d73..ec0abb97733 100644 --- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimPhase.tsx +++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimPhase.tsx @@ -86,6 +86,8 @@ function ClaimPhase({ phase, attributes, claimID, scrollIsEnabled, scrollViewRef ) + const stepNumberA11y = t('stepXofY', { current: phase, total: isDisabilityClaim ? 8 : 5 }) + let currentStatusA11y = '' if (isIncompletePhase) { currentStatusA11y = t('incomplete') @@ -102,7 +104,7 @@ function ClaimPhase({ phase, attributes, claimID, scrollIsEnabled, scrollViewRef completedStepsA11y = t('claimPhase.heading.a11y.stepCompleteRange', { lastStep: current - 1 }) } - let testID = `${t('claimPhase.heading.a11y.step', { step: phase })} ${heading}. ${currentStatusA11y}.` + let testID = `${stepNumberA11y}. ${heading}. ${currentStatusA11y}.` if (completedStepsA11y) { testID += ` ${completedStepsA11y}.` } diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.test.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.test.tsx index 4307400bb92..c8a140b51a1 100644 --- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.test.tsx +++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.test.tsx @@ -32,13 +32,15 @@ context('ClaimTimeline', () => { it('shows full list of steps', () => { initializeTestInstance(false) expect(screen.queryByText('You have 2 file requests from VA')).toBeFalsy() - expect(screen.getByLabelText('Step 1. Claim received. Complete.')).toBeTruthy() - expect(screen.getByLabelText('Step 2. Initial review. Complete.')).toBeTruthy() - expect(screen.getByLabelText('Step 3. Evidence gathering. Current step. Step 1 through 2 complete.')).toBeTruthy() - expect(screen.getByLabelText('Step 4. Evidence review. Incomplete.')).toBeTruthy() - expect(screen.getByLabelText('Step 5. Rating. Incomplete.')).toBeTruthy() - expect(screen.getByLabelText('Step 6. Preparing decision letter. Incomplete.')).toBeTruthy() - expect(screen.getByLabelText('Step 7. Final review. Incomplete.')).toBeTruthy() - expect(screen.getByLabelText('Step 8. Claim decided. Incomplete.')).toBeTruthy() + expect(screen.getByLabelText('Step 1 of 8. Claim received. Complete.')).toBeTruthy() + expect(screen.getByLabelText('Step 2 of 8. Initial review. Complete.')).toBeTruthy() + expect( + screen.getByLabelText('Step 3 of 8. Evidence gathering. Current step. Step 1 through 2 complete.'), + ).toBeTruthy() + expect(screen.getByLabelText('Step 4 of 8. Evidence review. Incomplete.')).toBeTruthy() + expect(screen.getByLabelText('Step 5 of 8. Rating. Incomplete.')).toBeTruthy() + expect(screen.getByLabelText('Step 6 of 8. Preparing decision letter. Incomplete.')).toBeTruthy() + expect(screen.getByLabelText('Step 7 of 8. Final review. Incomplete.')).toBeTruthy() + expect(screen.getByLabelText('Step 8 of 8. Claim decided. Incomplete.')).toBeTruthy() }) })