diff --git a/.github/workflows/e2e_detox_mapping.yml b/.github/workflows/e2e_detox_mapping.yml index b7a1ffbb162..366a531c42a 100644 --- a/.github/workflows/e2e_detox_mapping.yml +++ b/.github/workflows/e2e_detox_mapping.yml @@ -71,7 +71,7 @@ jobs: jq 'select(contains(["Login"])) += ["LoginScreen"] | select(contains(["AppealsDetailsScreen"])) += ["Appeals", "AppealsExpanded"] | select(contains(["NeedHelpData"]) or contains(["NoClaimsAndAppeals"]) or contains(["NoClaimsAndAppealsAccess"]) or contains(["ClaimsAndAppealsListView"]) or contains(["claimsAndAppeals"])) += ["Appeals", "AppealsExpanded", "Claims"] | - select(contains(["ClaimsDetailsScreen"]) or contains(["ClaimsLettersScreen"]) or contains(["ClaimsHistoryScreen"])) += ["Claims"] | + select(contains(["ClaimsDetailsScreen"]) or contains(["ClaimsLettersScreen"]) or contains(["SubmitEvidence"]) or contains(["ClaimsHistoryScreen"])) += ["Claims"] | select(contains(["ClaimsLettersScreen"]) or contains(["decisionLetters"])) += ["DecisionLetters"] | select(contains(["DisabilityRatingsScreen"]) or contains(["disabilityRating"])) += ["DisabilityRatings", "VeteranStatusCard"] | select(contains(["Letters"]) or contains(["letters"])) += ["VALetters"] | diff --git a/VAMobile/e2e/tests/AvailabilityFramework.e2e.ts b/VAMobile/e2e/tests/AvailabilityFramework.e2e.ts index 62c410b722f..683d47b1073 100644 --- a/VAMobile/e2e/tests/AvailabilityFramework.e2e.ts +++ b/VAMobile/e2e/tests/AvailabilityFramework.e2e.ts @@ -130,6 +130,15 @@ const AFNavigationForIndividual = [ ], ['BenefitLetters.e2e', 'WG_ClaimLettersScreen', 'Benefits', 'Claims', 'Claim letters'], ['Claims.e2e', 'WG_ClaimDetailsScreen', 'Benefits', 'Claims', 'Claims history', 'Received December 05, 2021'], + [ + 'Claims.e2e', + 'WG_SubmitEvidence', + 'Benefits', + 'Claims', + 'Claims history', + 'Received December 05, 2021', + 'Submit evidence', + ], ['Appeals.e2e', 'WG_AppealDetailsScreen', 'Benefits', 'Claims', 'Claims history', 'Received July 17, 2008'], [ 'Claims.e2e', diff --git a/VAMobile/e2e/tests/Claims.e2e.ts b/VAMobile/e2e/tests/Claims.e2e.ts index 5ce197a7fa5..93879bd5161 100644 --- a/VAMobile/e2e/tests/Claims.e2e.ts +++ b/VAMobile/e2e/tests/Claims.e2e.ts @@ -155,139 +155,63 @@ describe(':ios: Claims Screen', () => { await element(by.text(CommonE2eIdConstants.CLAIMS_HISTORY_BUTTON_TEXT)).tap() }) - it('automatically expands and scrolls to current step', async () => { + it('automatically expands and scrolls to current step and dates match', async () => { await element(by.id(ClaimsE2eIdConstants.CLAIM_4_ID)).tap() await expect(element(by.text('Received January 01, 2021'))).toExist() }) it('should verify that the review file request alert is visible', async () => { + await expect(element(by.label('You have 3 file requests'))).toExist() await waitFor(element(by.id(ClaimsE2eIdConstants.ALERT_FILE_REQUEST_BUTTON_ID))).toExist() }) - it('should tap on a claim and verify the dates match', async () => { - await element(by.id(ClaimsE2eIdConstants.CLAIMS_DETAILS_SCREEN_ID)).scrollTo('top') - await expect(element(by.text('Received January 01, 2021'))).toExist() + it('should verify that user is sent to File requests screen', async () => { + await element(by.id(ClaimsE2eIdConstants.ALERT_FILE_REQUEST_BUTTON_ID)).tap() + await expect(element(by.text('You have 3 file requests from VA'))).toExist() + await expect(element(by.text('Dental disability - More information needed'))).toExist() }) - it('verify number of requests in review file requests', async () => { - await expect(element(by.label('You have 3 file requests'))).toExist() - await element(by.text(CommonE2eIdConstants.CLAIMS_HISTORY_BUTTON_TEXT)).tap() + it('verify that the user is sent to the file upload page', async () => { + await element(by.text('Dental disability - More information needed')).tap() + await expect(element(by.text(ClaimsE2eIdConstants.SELECT_A_FILE_TEXT))).toExist() + await expect(element(by.text(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_TEXT))).toExist() + }) + + it('should back out of the file request screen and reenter a new file request screen', async () => { + await element(by.text('Back')).tap() + await element(by.text('Accidental injury - 21-4176 needed')).tap() + }) + + it('verify Review evaluation details', async () => { + await element(by.text('Back')).tap() + await element(by.id('fileRequestPageTestID')).scrollTo('bottom') + await element(by.id('Review evaluation details')).tap() + await expect(element(by.text('Claim evaluation'))).toExist() + await expect( + element( + by.text( + 'I have submitted all evidence that will support my claim and I’m not going to turn in any more information. I would like VA to make a decision on my claim based on the information already provided. (Required)', + ), + ), + ).toExist() + await expect(element(by.id('Request claim evaluation'))).toExist() }) - /******* Commented out because file request/review details buttons are moving *******/ - // - // it('should verify that the review file request button is visible in step 3', async () => { - // await waitFor(element(by.text('Review file requests'))) - // .toBeVisible() - // .whileElement(by.id(ClaimsE2eIdConstants.CLAIMS_DETAILS_SCREEN_ID)) - // .scroll(100, 'down') - // }) - - // it('expand step 3 and verify that the review file request button is visible', async () => { - // await element(by.id('Step 3 of 5. current. Evidence gathering, review, and decision June 4, 2021')).tap() - // await expect(element(by.id(ClaimsE2eIdConstants.FILE_REQUEST_BUTTON_ID))).toExist() - // await element(by.id('Step 3 of 5. current. Evidence gathering, review, and decision June 4, 2021')).tap() - // }) - - // it('verify that the user is sent to the file upload page', async () => { - // await element(by.text('Dental disability - More information needed')).tap() - // await expect(element(by.text(ClaimsE2eIdConstants.SELECT_A_FILE_TEXT))).toExist() - // await expect(element(by.text(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_TEXT))).toExist() - // }) - - // it('should back out of the file request screen and reenter a new file request screen', async () => { - // await element(by.text('Requests')).tap() - // await element(by.text('Accidental injury - 21-4176 needed')).tap() - // }) - - // it('verify the select files screen displays the correct info', async () => { - // await element(by.text(ClaimsE2eIdConstants.SELECT_A_FILE_TEXT)).tap() - // await expect(element(by.text('Select a file to upload for Accidental injury - 21-4176 needed'))).toExist() - // await expect(element(by.label(ClaimsE2eIdConstants.MAXIMUM_FILE_SIZE_LABEL))).toExist() - // await expect(element(by.text(ClaimsE2eIdConstants.ACCEPTED_FILE_TYPES_TEXT))).toExist() - // await expect(element(by.id(ClaimsE2eIdConstants.SELECT_A_FILE_TEXT)).atIndex(1)).toExist() - // }) - - // it('verify tap select a file options', async () => { - // if (device.getPlatform() === 'android') { - // await element(by.text(ClaimsE2eIdConstants.SELECT_A_FILE_TEXT)).atIndex(0).tap() - // } else { - // await element(by.id(ClaimsE2eIdConstants.SELECT_A_FILE_TEXT)).atIndex(0).tap() - // } - // await expect(element(by.text(ClaimsE2eIdConstants.SELECT_A_FILE_FILE_FOLDER_OPTION_TEXT))).toExist() - // await expect(element(by.text(CommonE2eIdConstants.CANCEL_PLATFORM_SPECIFIC_TEXT))).toExist() - // }) - - // it('should navigate back to the request select a file screen', async () => { - // if (device.getPlatform() === 'android') { - // await element(by.text(CommonE2eIdConstants.CANCEL_PLATFORM_SPECIFIC_TEXT)).tap() - // } else { - // await element(by.text(CommonE2eIdConstants.CANCEL_PLATFORM_SPECIFIC_TEXT)).atIndex(1).tap() - // } - // await element(by.text(CommonE2eIdConstants.CANCEL_UNIVERSAL_TEXT)).tap() - // }) - - // it('verify take or select photos panel', async () => { - // await element(by.text(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_TEXT)).tap() - // await expect(element(by.text('This feature is not yet accessible to screen readers'))).toExist() - // await expect(element(by.label(ClaimsE2eIdConstants.MAXIMUM_FILE_SIZE_LABEL))).toExist() - // await expect(element(by.text(ClaimsE2eIdConstants.ACCEPTED_FILE_TYPES_TEXT))).toExist() - // await expect(element(by.id(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_TEXT)).atIndex(1)).toExist() - // }) - - // it('should select take or select photos and verify the options given', async () => { - // await element(by.id('takePhotosTestID')).scrollTo('bottom') - // if (device.getPlatform() === 'android') { - // await element(by.id(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_TEXT)).atIndex(0).tap() - // } else { - // await element(by.id(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_TEXT)).atIndex(1).tap() - // } - // await expect(element(by.text(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_CAMERA_OPTION_TEXT))).toExist() - // await expect(element(by.text(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_PHOTO_GALLERY_OPTION_TEXT))).toExist() - // }) - - // it('should navigate back to the file request screen', async () => { - // if (device.getPlatform() === 'android') { - // await element(by.text(CommonE2eIdConstants.CANCEL_PLATFORM_SPECIFIC_TEXT)).tap() - // } else { - // await element(by.text(CommonE2eIdConstants.CANCEL_PLATFORM_SPECIFIC_TEXT)).atIndex(1).tap() - // } - // await element(by.text(CommonE2eIdConstants.CANCEL_UNIVERSAL_TEXT)).tap() - // await element(by.text('Requests')).tap() - // }) - - // it('verify Review evaluation details', async () => { - // await element(by.id('fileRequestPageTestID')).scrollTo('bottom') - // await element(by.id('Review evaluation details')).tap() - // await expect(element(by.text('Claim evaluation'))).toExist() - // await expect( - // element( - // by.text( - // 'I have submitted all evidence that will support my claim and I’m not going to turn in any more information. I would like VA to make a decision on my claim based on the information already provided. (Required)', - // ), - // ), - // ).toExist() - // await expect(element(by.id('Request claim evaluation'))).toExist() - // }) - - // it('verify error is displayed when request claim evaluation isnt checked', async () => { - // await element(by.id('askForClaimDecisionPageTestID')).scrollTo('bottom') - // await element(by.id('Request claim evaluation')).tap() - // await expect(element(by.text('Check the box to confirm the information is correct.'))).toExist() - // }) - - // it('should navigate back to the claims history screen', async () => { - // await element(by.text('Cancel')).tap() - // await element(by.text('Claim')).tap() - // await element(by.text(CommonE2eIdConstants.CLAIMS_HISTORY_BUTTON_TEXT)).tap() - // }) + it('verify error is displayed when request claim evaluation isnt checked', async () => { + await element(by.id('askForClaimDecisionPageTestID')).scrollTo('bottom') + await element(by.id('Request claim evaluation')).tap() + await expect(element(by.text('Check the box to confirm the information is correct.'))).toExist() + }) it('should verify details of claim on step 1', async () => { - await element(by.id(ClaimsE2eIdConstants.CLAIMS_HISTORY_SCREEN_ID)).scrollTo('top') + await element(by.text('Back')).tap() + await element(by.text('Cancel')).tap() + 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.text(ClaimsE2eIdConstants.CURRENT_STEP_TEXT))).toExist() - await expect(element(by.text('Thank you. VA received your claim'))) + await expect(element(by.text('Thank you. VA received your claim'))).toExist() await element(by.text(CommonE2eIdConstants.CLAIMS_HISTORY_BUTTON_TEXT)).tap() }) @@ -299,10 +223,85 @@ describe(':ios: Claims Screen', () => { by.text('Your claim has been assigned to a reviewer who is determining if additional information is needed.'), ), ).toExist() - await element(by.text(CommonE2eIdConstants.CLAIMS_HISTORY_BUTTON_TEXT)).tap() + }) + + it('should verify submit evidence button exists', async () => { + await element(by.id(ClaimsE2eIdConstants.CLAIMS_DETAILS_SCREEN_ID)).scrollTo('top') + await element(by.text('Submit evidence')).tap() + }) + + it('should verify submit evidence screen', async () => { + await expect(element(by.text('Submit evidence'))).toExist() + await expect(element(by.text('What to know before you submit evidence'))).toExist() + await expect( + element( + by.text( + 'You can submit evidence for this claim at any time. But if you submit evidence after Step 3, your claim will go back to that step for review.', + ), + ), + ).toExist() + await expect(element(by.text(ClaimsE2eIdConstants.SELECT_A_FILE_TEXT))).toExist() + await expect(element(by.text(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_TEXT))).toExist() + }) + + it('verify the select files screen displays the correct info', async () => { + await element(by.text(ClaimsE2eIdConstants.SELECT_A_FILE_TEXT)).tap() + await expect(element(by.text('Select a file to upload'))).toExist() + await expect(element(by.label(ClaimsE2eIdConstants.MAXIMUM_FILE_SIZE_LABEL))).toExist() + await expect(element(by.text(ClaimsE2eIdConstants.ACCEPTED_FILE_TYPES_TEXT))).toExist() + await expect(element(by.id(ClaimsE2eIdConstants.SELECT_A_FILE_TEXT)).atIndex(1)).toExist() + }) + + it('verify tap select a file options', async () => { + if (device.getPlatform() === 'android') { + await element(by.text(ClaimsE2eIdConstants.SELECT_A_FILE_TEXT)).atIndex(1).tap() + } else { + await element(by.id(ClaimsE2eIdConstants.SELECT_A_FILE_TEXT)).atIndex(1).tap() + } + await expect(element(by.text(ClaimsE2eIdConstants.SELECT_A_FILE_FILE_FOLDER_OPTION_TEXT))).toExist() + await expect(element(by.text(CommonE2eIdConstants.CANCEL_PLATFORM_SPECIFIC_TEXT))).toExist() + }) + + it('should navigate back to the submit evidence screen', async () => { + if (device.getPlatform() === 'android') { + await element(by.text(CommonE2eIdConstants.CANCEL_PLATFORM_SPECIFIC_TEXT)).tap() + } else { + await element(by.text(CommonE2eIdConstants.CANCEL_PLATFORM_SPECIFIC_TEXT)).atIndex(1).tap() + } + await element(by.text('Back')).tap() + }) + + it('should verify take or select photos flow', async () => { + await element(by.text(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_TEXT)).tap() + await expect(element(by.text('This feature is not yet accessible to screen readers'))).toExist() + await expect(element(by.label(ClaimsE2eIdConstants.MAXIMUM_FILE_SIZE_LABEL))).toExist() + await expect(element(by.text(ClaimsE2eIdConstants.ACCEPTED_FILE_TYPES_TEXT))).toExist() + await expect(element(by.id(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_TEXT)).atIndex(1)).toExist() + }) + + it('should select take or select photos and verify the options given', async () => { + await element(by.id('takePhotosTestID')).scrollTo('bottom') + if (device.getPlatform() === 'android') { + await element(by.id(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_TEXT)).atIndex(0).tap() + } else { + await element(by.id(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_TEXT)).atIndex(1).tap() + } + await expect(element(by.text(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_CAMERA_OPTION_TEXT))).toExist() + await expect(element(by.text(ClaimsE2eIdConstants.TAKE_OR_SELECT_PHOTOS_PHOTO_GALLERY_OPTION_TEXT))).toExist() + }) + + it('should navigate back to the claim details screen', async () => { + if (device.getPlatform() === 'android') { + await element(by.text(CommonE2eIdConstants.CANCEL_PLATFORM_SPECIFIC_TEXT)).tap() + } else { + await element(by.text(CommonE2eIdConstants.CANCEL_PLATFORM_SPECIFIC_TEXT)).atIndex(1).tap() + } + await element(by.text('Back')).tap() + await element(by.text('Cancel')).tap() }) it('should verify details of claim on step 3 w/ waiver', async () => { + await element(by.text(CommonE2eIdConstants.CLAIMS_HISTORY_BUTTON_TEXT)).tap() await waitFor(element(by.id(ClaimsE2eIdConstants.CLAIM_5_ID))) .toBeVisible() .whileElement(by.id(ClaimsE2eIdConstants.CLAIMS_HISTORY_SCREEN_ID)) diff --git a/VAMobile/e2e/tests/Navigation.e2e.ts b/VAMobile/e2e/tests/Navigation.e2e.ts index b73b920fe7d..f20a664131e 100644 --- a/VAMobile/e2e/tests/Navigation.e2e.ts +++ b/VAMobile/e2e/tests/Navigation.e2e.ts @@ -36,6 +36,7 @@ const navigationDic = { ['Claims.e2e', ['Claims', 'Claims history', 'Closed'], 'Your closed claims, decision reviews, and appeals'], ['Claims.e2e', ['Claims', 'Claims history', 'Active'], 'Your active claims, decision reviews, and appeals'], ['Claims.e2e', ['Claims', 'Claims history', 'Received July 20, 2021'], 'Claim details'], + ['Claims.e2e', ['Claims', 'Claims history', 'Received July 20, 2021', 'Submit evidence'], 'Submit evidence'], ['Claims.e2e', ['Claims', 'Claims history', 'Received January 01, 2021', 'Review file requests'], 'File requests'], [ 'Claims.e2e', @@ -261,7 +262,7 @@ const navigateToPage = async (key, navigationDicValue) => { .toBeVisible() .whileElement(by.id('claimsHistoryID')) .scroll(100, 'down') - } else if (subNavigationArray.slice(-1)[0] === 'Files') { + } else if (subNavigationArray.slice(-1)[0] === 'Files' || subNavigationArray.slice(-1)[0] === 'Submit evidence') { await element(by.id('ClaimDetailsScreen')).scrollTo('top') } diff --git a/VAMobile/e2e/tests/utils.ts b/VAMobile/e2e/tests/utils.ts index 9e11b4546d4..53f6706cb71 100644 --- a/VAMobile/e2e/tests/utils.ts +++ b/VAMobile/e2e/tests/utils.ts @@ -373,7 +373,8 @@ export async function enableAF(AFFeature, AFUseCase, AFAppUpdate = false) { AFFeature === 'WG_WhatToKnow' || AFFeature === 'WG_EditAddress' || AFFeature === 'WG_EditPhoneNumber' || - AFFeature === 'WG_EditEmail') && + AFFeature === 'WG_EditEmail' || + AFFeature === 'WG_ConsolidatedClaimsNote') && AFUseCase === 'DenyAccess' ) { await resetInAppReview() diff --git a/VAMobile/src/api/claimsAndAppeals/uploadFileToClaim.tsx b/VAMobile/src/api/claimsAndAppeals/uploadFileToClaim.tsx index 028c1ea2d3c..a3d7ba3b1bf 100644 --- a/VAMobile/src/api/claimsAndAppeals/uploadFileToClaim.tsx +++ b/VAMobile/src/api/claimsAndAppeals/uploadFileToClaim.tsx @@ -22,8 +22,11 @@ import { claimsAndAppealsKeys } from './queryKeys' /** * Uploads a File to Claim + * + * request is only required if the upload is tied to a file request + * if the upload is not tied to a file request, request is null but documentType is required */ -const uploadFileToClaim = ({ claimID, request, files }: UploadFileToClaimParamaters) => { +const uploadFileToClaim = ({ claimID, documentType, request, files }: UploadFileToClaimParamaters) => { if (files.length > 1) { const fileStrings = files.map((file: DocumentPickerResponse | Asset) => { return file.base64 @@ -32,8 +35,8 @@ const uploadFileToClaim = ({ claimID, request, files }: UploadFileToClaimParamat const payload = JSON.parse( JSON.stringify({ files: fileStrings, - trackedItemId: request.trackedItemId, - document_type: request.documentType, + trackedItemId: request?.trackedItemId, + document_type: request?.documentType || documentType, }), ) return post(`/v0/claim/${claimID}/documents/multi-image`, payload as unknown as Params) @@ -67,8 +70,12 @@ const uploadFileToClaim = ({ claimID, request, files }: UploadFileToClaimParamat ), ) - formData.append('trackedItemId', JSON.parse(JSON.stringify(request.trackedItemId))) - formData.append('documentType', JSON.parse(JSON.stringify(request.documentType))) + if (request) { + formData.append('trackedItemId', JSON.parse(JSON.stringify(request.trackedItemId))) + formData.append('documentType', JSON.parse(JSON.stringify(request.documentType))) + } else { + formData.append('documentType', documentType) + } return post( `/v0/claim/${claimID}/documents`, formData as unknown as Params, @@ -79,29 +86,43 @@ const uploadFileToClaim = ({ claimID, request, files }: UploadFileToClaimParamat /** * Returns a mutation for Uploading a File to Claim + * request is only required if the upload is tied to a file request */ export const useUploadFileToClaim = ( claimID: string, - request: ClaimEventData, + request: ClaimEventData | undefined, files: Array | Array | undefined, ) => { const queryClient = useQueryClient() - const dateUploadedString = DateTime.local().toISO() - const claimData = queryClient.getQueryData([claimsAndAppealsKeys.claim, claimID]) as ClaimData - const indexOfRequest = claimData.attributes.eventsTimeline.findIndex((el) => el.description === request.description) - claimData.attributes.eventsTimeline[indexOfRequest].uploaded = true - claimData.attributes.eventsTimeline[indexOfRequest].status = FILE_REQUEST_STATUS.SUBMITTED_AWAITING_REVIEW - claimData.attributes.eventsTimeline[indexOfRequest].documents = createFileRequestDocumentsArray( - files || [], - request?.trackedItemId || undefined, - request?.documentType || '', - dateUploadedString, - ) - claimData.attributes.eventsTimeline[indexOfRequest].uploadDate = dateUploadedString - return useMutation({ mutationFn: uploadFileToClaim, onSuccess: () => { + const dateUploadedString = DateTime.local().toISO() + const claimData = queryClient.getQueryData([claimsAndAppealsKeys.claim, claimID]) as ClaimData + if (request) { + const indexOfRequest = claimData.attributes.eventsTimeline.findIndex( + (el) => el.description === request.description, + ) + claimData.attributes.eventsTimeline[indexOfRequest].uploaded = true + claimData.attributes.eventsTimeline[indexOfRequest].status = FILE_REQUEST_STATUS.SUBMITTED_AWAITING_REVIEW + claimData.attributes.eventsTimeline[indexOfRequest].documents = createFileRequestDocumentsArray( + files || [], + request?.trackedItemId || undefined, + request?.documentType || '', + dateUploadedString, + ) + claimData.attributes.eventsTimeline[indexOfRequest].uploadDate = dateUploadedString + } else { + const claimEvent: ClaimEventData = { + type: '', + date: dateUploadedString, + status: FILE_REQUEST_STATUS.SUBMITTED_AWAITING_REVIEW, + uploaded: true, + uploadDate: dateUploadedString, + documents: createFileRequestDocumentsArray(files || [], undefined, '', dateUploadedString), + } + claimData.attributes.eventsTimeline.push(claimEvent) + } const setDataOptions: SetDataOptions = { updatedAt: DateTime.now().toMillis(), } diff --git a/VAMobile/src/api/types/ClaimsAndAppealsData.ts b/VAMobile/src/api/types/ClaimsAndAppealsData.ts index 3233b230253..8f1f9c90fea 100644 --- a/VAMobile/src/api/types/ClaimsAndAppealsData.ts +++ b/VAMobile/src/api/types/ClaimsAndAppealsData.ts @@ -588,6 +588,7 @@ export const FILE_REQUEST_STATUS: { export type UploadFileToClaimParamaters = { claimID: string - request: ClaimEventData + documentType: string + request: ClaimEventData | undefined files: Array | Array } diff --git a/VAMobile/src/screens/BenefitsScreen/BenefitsScreen.tsx b/VAMobile/src/screens/BenefitsScreen/BenefitsScreen.tsx index edefc823abe..e80bc75a6bd 100644 --- a/VAMobile/src/screens/BenefitsScreen/BenefitsScreen.tsx +++ b/VAMobile/src/screens/BenefitsScreen/BenefitsScreen.tsx @@ -9,7 +9,7 @@ import { useClaimsAndAppeals } from 'api/claimsAndAppeals' import { Box, CategoryLanding, CategoryLandingAlert, LargeNavButton } from 'components' import { CloseSnackbarOnNavigation } from 'constants/common' import { NAMESPACE } from 'constants/namespaces' -import { FEATURE_LANDING_TEMPLATE_OPTIONS } from 'constants/screens' +import { FEATURE_LANDING_TEMPLATE_OPTIONS, FULLSCREEN_SUBTASK_OPTIONS } from 'constants/screens' import ClaimsScreen from 'screens/BenefitsScreen/ClaimsScreen' import AppealDetailsScreen from 'screens/BenefitsScreen/ClaimsScreen/AppealDetailsScreen/AppealDetailsScreen' import ClaimDetailsScreen from 'screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen' @@ -26,6 +26,7 @@ import { featureEnabled } from 'utils/remoteConfig' import { screenContentAllowed } from 'utils/waygateConfig' import { BenefitsStackParamList } from './BenefitsStackScreens' +import SubmitEvidence from './ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimFileUpload/SubmitEvidence' import ClaimLettersScreen from './ClaimsScreen/ClaimLettersScreen/ClaimLettersScreen' type BenefitsScreenProps = StackScreenProps @@ -147,7 +148,12 @@ function BenefitsStackScreen() { component={DisabilityRatingsScreen} options={{ headerShown: false }} /> - + + => { key={'AskForClaimDecision'} name="AskForClaimDecision" component={AskForClaimDecision} - options={FULLSCREEN_SUBTASK_OPTIONS} + options={{ headerShown: false }} />, , , , , ] } diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.test.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.test.tsx index 8ac6d2053c0..106b7966f41 100644 --- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.test.tsx +++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.test.tsx @@ -31,6 +31,7 @@ context('ClaimDetailsScreen', () => { claim?: Partial, ): void => { when(featureEnabled).calledWith('claimPhaseExpansion').mockReturnValue(featureFlag) + when(featureEnabled).calledWith('submitEvidenceExpansion').mockReturnValue(featureFlag) let queriesData: QueriesData | undefined if (claim) { queriesData = [ @@ -74,6 +75,19 @@ context('ClaimDetailsScreen', () => { }) }) + describe('submit evidence ', () => { + it('submit evidence button should exist', async () => { + renderWithData(ClaimTypeConstants.ACTIVE, true, { + ...claimData, + attributes: { + ...claimData.attributes, + phase: 2, + }, + }) + await waitFor(() => expect(screen.getByRole('button', { name: 'Submit evidence' })).toBeTruthy()) + }) + }) + describe('when the selected tab is status', () => { it('should display the ClaimStatus component', async () => { renderWithData(ClaimTypeConstants.ACTIVE, false, { @@ -123,12 +137,12 @@ context('ClaimDetailsScreen', () => { await waitFor(() => expect(Linking.openURL).toHaveBeenCalled()) }) - it('should display on claim details, to be renamed files tab', async () => { - renderWithData(ClaimTypeConstants.ACTIVE, false, { + it('should display on claim files tab', async () => { + renderWithData(ClaimTypeConstants.ACTIVE, true, { ...claimData, }) - await waitFor(() => fireEvent.press(screen.getByText('Details'))) - await waitFor(() => fireEvent.press(screen.getByText('Details'))) + await waitFor(() => fireEvent.press(screen.getByText('Files'))) + await waitFor(() => fireEvent.press(screen.getByText('Files'))) await waitFor(() => expect(screen.getByRole('header', { name: 'Need help?' })).toBeTruthy()) }) }) diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.tsx index 8d5cadae41a..2def1723fda 100644 --- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.tsx +++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.tsx @@ -7,7 +7,10 @@ import { StackScreenProps } from '@react-navigation/stack/lib/typescript/src/typ import { ButtonVariants, SegmentedControl } from '@department-of-veterans-affairs/mobile-component-library' import { AlertProps } from '@department-of-veterans-affairs/mobile-component-library/src/components/Alert/Alert' -import { ButtonProps } from '@department-of-veterans-affairs/mobile-component-library/src/components/Button/Button' +import { + Button, + ButtonProps, +} from '@department-of-veterans-affairs/mobile-component-library/src/components/Button/Button' import { useQueryClient } from '@tanstack/react-query' import { TFunction } from 'i18next' @@ -86,6 +89,7 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) { ) //force a rerender due to react query updating data const claimPhaseExpansionFlag = featureEnabled('claimPhaseExpansion') + const submitEvidenceExpansionFlag = featureEnabled('submitEvidenceExpansion') useBeforeNavBackListener(navigation, () => { // if claim is still loading cancel it @@ -172,6 +176,11 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) { navigateTo('FileRequest', { claimID, claim }) } + const submitEvidencePress = () => { + logAnalyticsEvent(Events.vama_claim_review(claimID, attributes.claimType, count)) + navigateTo('SubmitEvidence', { claimID }) + } + const getActiveClosedClaimInformationAlertOrSubmitButton = () => { if (claimType === ClaimTypeConstants.CLOSED) { const isDecisionLetterReady = @@ -225,6 +234,17 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) { ) + } else if (submitEvidenceExpansionFlag && attributes?.open) { + const buttonProps: ButtonProps = { + buttonType: ButtonVariants.Primary, + label: t('claimDetails.submitEvidence'), + onPress: submitEvidencePress, + } + return ( + +