Skip to content

Commit

Permalink
feature/9448-add-item-count-to-step-timeline-announcement (#9566)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandec authored Sep 11, 2024
1 parent 4abbc91 commit 9a18814
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 50 deletions.
40 changes: 20 additions & 20 deletions VAMobile/e2e/tests/Claims.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -209,15 +209,15 @@ 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()
})

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.'),
Expand Down Expand Up @@ -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(
Expand All @@ -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()
Expand All @@ -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()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ScrollView>,
Expand All @@ -34,25 +35,25 @@ context('ClaimPhase', () => {
render(<ClaimPhase {...props} />)
}

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()
})
})

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.",
Expand All @@ -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(
Expand All @@ -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."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ function ClaimPhase({ phase, attributes, claimID, scrollIsEnabled, scrollViewRef
</TextView>
)

const stepNumberA11y = t('stepXofY', { current: phase, total: isDisabilityClaim ? 8 : 5 })

let currentStatusA11y = ''
if (isIncompletePhase) {
currentStatusA11y = t('incomplete')
Expand All @@ -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}.`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
})

0 comments on commit 9a18814

Please sign in to comment.