Skip to content

Commit

Permalink
feature/9168-RemoveClaimPhaseExpansionFlag (#9613)
Browse files Browse the repository at this point in the history
Co-authored-by: Rachael Bontrager <[email protected]>
  • Loading branch information
Sparowhawk and rbontrager authored Sep 27, 2024
1 parent 9fce707 commit dcf5a0a
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 759 deletions.
1 change: 0 additions & 1 deletion VAMobile/e2e/tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const CommonE2eIdConstants = {
START_NEW_MESSAGE_BUTTON_ID: 'startNewMessageButtonTestID',
PRESCRIPTION_REFILL_BUTTON_TEXT: 'Start refill request',
HOME_ACTIVITY_HEADER_TEXT: 'Activity',
CLAIM_PHASE_TOGGLE_TEXT: 'claimPhaseExpansion',
IN_APP_REVIEW_TOGGLE_TEXT: 'inAppReview',
CALL_VA_PHONE_NUMBER_ID: 'CallVATestID',
CALL_VA_TTY_PHONE_NUMBER_ID: 'CallTTYTestID',
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ context('ClaimDetailsScreen', () => {
featureFlag: boolean = false,
claim?: Partial<ClaimData>,
): void => {
when(featureEnabled).calledWith('claimPhaseExpansion').mockReturnValue(featureFlag)
when(featureEnabled).calledWith('submitEvidenceExpansion').mockReturnValue(featureFlag)
let queriesData: QueriesData | undefined
if (claim) {
Expand Down Expand Up @@ -93,19 +92,7 @@ context('ClaimDetailsScreen', () => {
renderWithData(ClaimTypeConstants.ACTIVE, false, {
...claimData,
})
await waitFor(() =>
expect(screen.getByTestId('Step 1 of 5. completed. Claim received June 6, 2019')).toBeTruthy(),
)
})

it('should display the ClaimDetails component', async () => {
renderWithData(ClaimTypeConstants.ACTIVE, false, {
...claimData,
})
await waitFor(() => fireEvent.press(screen.getByText('Details')))
await waitFor(() => fireEvent.press(screen.getByText('Details')))

await waitFor(() => expect(screen.getByText('Claim type')).toBeTruthy())
await waitFor(() => expect(screen.getByTestId('Step 1 of 8. Claim received. Complete.')).toBeTruthy())
})

it('should display the Files component', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import { featureEnabled } from 'utils/remoteConfig'
import { screenContentAllowed } from 'utils/waygateConfig'

import NeedHelpData from '../NeedHelpData/NeedHelpData'
import ClaimDetails from './ClaimDetails/ClaimDetails'
import ClaimFiles from './ClaimFiles/ClaimFiles'
import ClaimStatus from './ClaimStatus/ClaimStatus'

Expand All @@ -57,10 +56,7 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) {
const { t } = useTranslation(NAMESPACE.COMMON)
const scrollViewRef = useRef<ScrollView>(null)
const navigateTo = useRouteNavigation()
const controlLabels = [
t('claimDetails.status'),
featureEnabled('claimPhaseExpansion') ? t('files') : t('claimDetails.details'),
]
const controlLabels = [t('claimDetails.status'), t('files')]
const [selectedTab, setSelectedTab] = useState(0)

const { claimID, claimType } = route.params
Expand Down Expand Up @@ -90,7 +86,6 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) {
}, [attributes]),
) //force a rerender due to react query updating data

const claimPhaseExpansionFlag = featureEnabled('claimPhaseExpansion')
const submitEvidenceExpansionFlag = featureEnabled('submitEvidenceExpansion')

useBeforeNavBackListener(navigation, () => {
Expand Down Expand Up @@ -123,15 +118,13 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) {

useEffect(() => {
if (claimType === ClaimTypeConstants.ACTIVE && claim) {
if (claimPhaseExpansionFlag) {
if (count > 0 && !claim.attributes.waiverSubmitted) {
logAnalyticsEvent(Events.vama_claim_file_request(claimID))
} else if (submitEvidenceExpansionFlag && claim.attributes.open && count >= 0) {
logAnalyticsEvent(Events.vama_claim_submit_ev(claimID))
}
if (count > 0 && !claim.attributes.waiverSubmitted) {
logAnalyticsEvent(Events.vama_claim_file_request(claimID))
} else if (submitEvidenceExpansionFlag && claim.attributes.open && count >= 0) {
logAnalyticsEvent(Events.vama_claim_submit_ev(claimID))
}
}
}, [claimType, claimPhaseExpansionFlag, submitEvidenceExpansionFlag, count, claim, claimID])
}, [claimType, submitEvidenceExpansionFlag, count, claim, claimID])

// Track how long user maintains focus on this screen
useFocusEffect(
Expand Down Expand Up @@ -229,37 +222,35 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) {
</Box>
)
}
if (claimPhaseExpansionFlag) {
if (count > 0 && !claim?.attributes?.waiverSubmitted) {
const buttonProps: ButtonProps = {
buttonType: ButtonVariants.Primary,
label: t('claimPhase.fileRequests.button.label'),
a11yHint: t('claimPhase.fileRequests.button.a11yHint'),
onPress: fileRequestsPress,
}
const alertProps: AlertProps = {
variant: 'warning',
header: t('claimPhase.youHaveFileRequest', { count }),
primaryButton: buttonProps,
expandable: false,
}
return (
<Box mt={theme.dimensions.standardMarginBetween}>
<AlertWithHaptics {...alertProps} />
</Box>
)
} else if (submitEvidenceExpansionFlag && attributes?.open) {
const buttonProps: ButtonProps = {
buttonType: ButtonVariants.Primary,
label: t('claimDetails.submitEvidence'),
onPress: submitEvidencePress,
}
return (
<Box mt={theme.dimensions.standardMarginBetween} mx={theme.dimensions.gutter}>
<Button {...buttonProps} />
</Box>
)
if (count > 0 && !claim?.attributes?.waiverSubmitted) {
const buttonProps: ButtonProps = {
buttonType: ButtonVariants.Primary,
label: t('claimPhase.fileRequests.button.label'),
a11yHint: t('claimPhase.fileRequests.button.a11yHint'),
onPress: fileRequestsPress,
}
const alertProps: AlertProps = {
variant: 'warning',
header: t('claimPhase.youHaveFileRequest', { count }),
primaryButton: buttonProps,
expandable: false,
}
return (
<Box mt={theme.dimensions.standardMarginBetween}>
<AlertWithHaptics {...alertProps} />
</Box>
)
} else if (submitEvidenceExpansionFlag && attributes?.open) {
const buttonProps: ButtonProps = {
buttonType: ButtonVariants.Primary,
label: t('claimDetails.submitEvidence'),
onPress: submitEvidencePress,
}
return (
<Box mt={theme.dimensions.standardMarginBetween} mx={theme.dimensions.gutter}>
<Button {...buttonProps} />
</Box>
)
}
return <></>
}
Expand Down Expand Up @@ -347,8 +338,7 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) {
scrollViewRef={scrollViewRef}
/>
)}
{claim && selectedTab === 1 && !featureEnabled('claimPhaseExpansion') && <ClaimDetails claim={claim} />}
{claim && selectedTab === 1 && featureEnabled('claimPhaseExpansion') && <ClaimFiles claim={claim} />}
{claim && selectedTab === 1 && <ClaimFiles claim={claim} />}
</Box>
{renderActiveClosedClaimStatusHelpLink()}
<Box mt={theme.dimensions.condensedMarginBetween}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { ScrollView } from 'react-native'
import { screen } from '@testing-library/react-native'

import { ClaimType } from 'constants/claims'
import { context, mockNavProps, render, when } from 'testUtils'
import { featureEnabled } from 'utils/remoteConfig'
import { context, mockNavProps, render } from 'testUtils'

import { claim } from '../../claimData'
import ClaimStatus from './ClaimStatus'
Expand All @@ -19,9 +18,6 @@ jest.mock('utils/hooks', () => {
}
})

jest.mock('utils/remoteConfig')
when(featureEnabled).calledWith('claimPhaseExpansion').mockReturnValue(true)

context('ClaimStatus', () => {
const defaultMaxEstDate = '2019-12-11'
const initializeTestInstance = (maxEstDate: string, claimType: ClaimType): void => {
Expand Down
Loading

0 comments on commit dcf5a0a

Please sign in to comment.