From a879730023527633967e9cb327a12c23e89d2f0a Mon Sep 17 00:00:00 2001
From: Logan Cunningham <148146808+loganwc@users.noreply.github.com>
Date: Wed, 2 Oct 2024 15:51:59 -0700
Subject: [PATCH] INT-B-21115 (#13819)
* mostly removed conus/oconus references
* removed ConusOrNot and it's references
* removed back button from dod info page
* fixed test for thing that's not even there
* removed conus reference in playwright test
---
playwright/tests/my/mymove/onboarding.spec.js | 10 --
.../Customer/DodInfoForm/DodInfoForm.jsx | 9 +-
.../Customer/DodInfoForm/DodInfoForm.test.jsx | 11 --
src/constants/routes.js | 1 -
.../requireCustomerState.test.jsx | 2 +-
src/pages/MyMove/ConusOrNot.jsx | 106 ------------------
src/pages/MyMove/ConusOrNot.test.jsx | 33 ------
src/pages/MyMove/Profile/DodInfo.jsx | 6 +-
src/pages/MyMove/Profile/DodInfo.test.jsx | 12 --
src/pages/MyMove/Profile/Name.test.jsx | 2 +-
src/pages/MyMove/Profile/ValidationCode.jsx | 2 +-
.../MyMove/Profile/ValidationCode.test.jsx | 2 +-
src/scenes/MyMove/getWorkflowRoutes.jsx | 6 -
src/scenes/MyMove/getWorkflowRoutes.test.js | 1 -
src/utils/customer.js | 2 +-
15 files changed, 8 insertions(+), 197 deletions(-)
delete mode 100644 src/pages/MyMove/ConusOrNot.jsx
delete mode 100644 src/pages/MyMove/ConusOrNot.test.jsx
diff --git a/playwright/tests/my/mymove/onboarding.spec.js b/playwright/tests/my/mymove/onboarding.spec.js
index c9aa3203b96..a24e874a6c1 100644
--- a/playwright/tests/my/mymove/onboarding.spec.js
+++ b/playwright/tests/my/mymove/onboarding.spec.js
@@ -13,11 +13,6 @@ test.describe('Onboarding', () => {
// Input validation code
await customerPage.submitParameterValue();
- // CONUS/OCONUS section
- await customerPage.waitForPage.onboardingConus();
- await page.getByText('Starts and ends in the continental US').click();
- await customerPage.navigateForward();
-
// Branch/DOD ID section
await customerPage.waitForPage.onboardingDodId();
await page.getByRole('combobox', { name: 'Branch of service' }).selectOption({ label: 'Space Force' });
@@ -79,11 +74,6 @@ test.describe('(MultiMove) Onboarding', () => {
await customerPage.submitParameterValue();
}
- // CONUS/OCONUS section
- await customerPage.waitForPage.onboardingConus();
- await page.getByText('Starts and ends in the continental US').click();
- await customerPage.navigateForward();
-
// Branch/DOD ID/Rank section
await customerPage.waitForPage.onboardingDodId();
await page.getByRole('combobox', { name: 'Branch of service' }).selectOption({ label: 'Space Force' });
diff --git a/src/components/Customer/DodInfoForm/DodInfoForm.jsx b/src/components/Customer/DodInfoForm/DodInfoForm.jsx
index 93deb333eee..1c62e472c71 100644
--- a/src/components/Customer/DodInfoForm/DodInfoForm.jsx
+++ b/src/components/Customer/DodInfoForm/DodInfoForm.jsx
@@ -13,7 +13,7 @@ import { dropdownInputOptions } from 'utils/formatters';
import formStyles from 'styles/form.module.scss';
import { isBooleanFlagEnabled } from 'utils/featureFlags';
-const DodInfoForm = ({ initialValues, onSubmit, onBack }) => {
+const DodInfoForm = ({ initialValues, onSubmit }) => {
const branchOptions = dropdownInputOptions(SERVICE_MEMBER_AGENCY_LABELS);
const [showEmplid, setShowEmplid] = useState(initialValues.affiliation === 'COAST_GUARD');
const [isDodidDisabled, setIsDodidDisabled] = useState(false);
@@ -104,11 +104,7 @@ const DodInfoForm = ({ initialValues, onSubmit, onBack }) => {
-
+
);
@@ -123,7 +119,6 @@ DodInfoForm.propTypes = {
edipi: PropTypes.string,
}).isRequired,
onSubmit: PropTypes.func.isRequired,
- onBack: PropTypes.func.isRequired,
};
export default DodInfoForm;
diff --git a/src/components/Customer/DodInfoForm/DodInfoForm.test.jsx b/src/components/Customer/DodInfoForm/DodInfoForm.test.jsx
index 7eda863d955..86bf9e26e8d 100644
--- a/src/components/Customer/DodInfoForm/DodInfoForm.test.jsx
+++ b/src/components/Customer/DodInfoForm/DodInfoForm.test.jsx
@@ -81,17 +81,6 @@ describe('DodInfoForm component', () => {
});
});
- it('implements the onBack handler when the Back button is clicked', async () => {
- const { getByRole } = render();
- const backBtn = getByRole('button', { name: 'Back' });
-
- await userEvent.click(backBtn);
-
- await waitFor(() => {
- expect(testProps.onBack).toHaveBeenCalled();
- });
- });
-
describe('Coast Guard Customers', () => {
it('shows an error message if EMPLID not present ', async () => {
const { getByRole, getAllByTestId, getByLabelText } = render();
diff --git a/src/constants/routes.js b/src/constants/routes.js
index 9beb67b7dc6..1c4121aef59 100644
--- a/src/constants/routes.js
+++ b/src/constants/routes.js
@@ -12,7 +12,6 @@ export const customerRoutes = {
MOVE_HOME_PAGE: '/move',
MOVE_HOME_PATH: '/move/:moveId',
VALIDATION_CODE_PATH: '/service-member/validation-code',
- CONUS_OCONUS_PATH: '/service-member/conus-oconus',
DOD_INFO_PATH: '/service-member/dod-info',
NAME_PATH: '/service-member/name',
CONTACT_INFO_PATH: '/service-member/contact-info',
diff --git a/src/containers/requireCustomerState/requireCustomerState.test.jsx b/src/containers/requireCustomerState/requireCustomerState.test.jsx
index 13f0c3635b8..e06645bdefc 100644
--- a/src/containers/requireCustomerState/requireCustomerState.test.jsx
+++ b/src/containers/requireCustomerState/requireCustomerState.test.jsx
@@ -89,7 +89,7 @@ describe('requireCustomerState HOC', () => {
await waitFor(() => {
expect(wrapper.exists()).toBe(true);
});
- expect(mockNavigate).toHaveBeenCalledWith('/service-member/conus-oconus');
+ expect(mockNavigate).toHaveBeenCalledWith('/service-member/dod-info');
});
it('does not redirect if the current state equals the required state', () => {
diff --git a/src/pages/MyMove/ConusOrNot.jsx b/src/pages/MyMove/ConusOrNot.jsx
deleted file mode 100644
index a231743f7a2..00000000000
--- a/src/pages/MyMove/ConusOrNot.jsx
+++ /dev/null
@@ -1,106 +0,0 @@
-import React, { useState } from 'react';
-import { connect } from 'react-redux';
-import { func, PropTypes } from 'prop-types';
-import { Formik } from 'formik';
-import { useNavigate } from 'react-router-dom';
-import { GridContainer, Grid } from '@trussworks/react-uswds';
-
-import SelectableCard from 'components/Customer/SelectableCard';
-import { setConusStatus } from 'store/onboarding/actions';
-import { selectConusStatus } from 'store/onboarding/selectors';
-import { CONUS_STATUS } from 'shared/constants';
-import SectionWrapper from 'components/Customer/SectionWrapper';
-import formStyles from 'styles/form.module.scss';
-import WizardNavigation from 'components/Customer/WizardNavigation/WizardNavigation';
-import { Form } from 'components/form/Form';
-import { customerRoutes } from 'constants/routes';
-import { selectServiceMemberFromLoggedInUser } from 'store/entities/selectors';
-
-const ConusOrNot = ({ setLocation, conusStatus }) => {
- const navigate = useNavigate();
- const [locationValue, setlocationValue] = useState('');
-
- const oconusCardText = (
- <>
- Starts or ends in Alaska, Hawaii, or International locations
- MilMove does not support OCONUS moves yet. Contact your current transportation office to set up
- your move.
- >
- );
-
- const initialValues = {
- conusStatus: locationValue,
- };
-
- const onSubmit = () => {
- navigate(customerRoutes.DOD_INFO_PATH);
- };
-
- return (
-
-
-
-
- {({ isValid, handleSubmit }) => {
- return (
-
- );
- }}
-
-
-
-
- );
-};
-
-ConusOrNot.propTypes = {
- setLocation: func.isRequired,
- conusStatus: PropTypes.string,
-};
-
-ConusOrNot.defaultProps = {
- conusStatus: '',
-};
-
-const mapStateToProps = (state) => ({
- conusStatus: selectConusStatus(state),
- serviceMember: selectServiceMemberFromLoggedInUser(state),
-});
-
-const mapDispatchToProps = {
- setLocation: setConusStatus,
-};
-
-export default connect(mapStateToProps, mapDispatchToProps)(ConusOrNot);
diff --git a/src/pages/MyMove/ConusOrNot.test.jsx b/src/pages/MyMove/ConusOrNot.test.jsx
deleted file mode 100644
index 0b2bb9bcad8..00000000000
--- a/src/pages/MyMove/ConusOrNot.test.jsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import { screen } from '@testing-library/react';
-import userEvent from '@testing-library/user-event';
-
-import ConusOrNot from './ConusOrNot';
-
-import { renderWithProviders } from 'testUtils';
-import { customerRoutes } from 'constants/routes';
-
-const mockNavigate = jest.fn();
-jest.mock('react-router-dom', () => ({
- ...jest.requireActual('react-router-dom'),
- useNavigate: () => mockNavigate,
-}));
-
-describe('ConusOrNot', () => {
- test('it should render all text for the component', async () => {
- renderWithProviders();
-
- expect(screen.getByText('Where are you moving?')).toBeInTheDocument();
- expect(screen.getByText('CONUS')).toBeInTheDocument();
- expect(screen.getByText('OCONUS')).toBeInTheDocument();
- });
-
- test('it selects an option and navigates the user', async () => {
- renderWithProviders();
-
- userEvent.click(screen.getByText('CONUS'));
- const nextBtn = await screen.findByRole('button', { name: 'Next' });
- await userEvent.click(nextBtn);
- expect(mockNavigate).toHaveBeenCalledWith(customerRoutes.DOD_INFO_PATH);
- });
-});
diff --git a/src/pages/MyMove/Profile/DodInfo.jsx b/src/pages/MyMove/Profile/DodInfo.jsx
index 51f58b3f31c..704e589149d 100644
--- a/src/pages/MyMove/Profile/DodInfo.jsx
+++ b/src/pages/MyMove/Profile/DodInfo.jsx
@@ -24,10 +24,6 @@ export const DodInfo = ({ updateServiceMember, serviceMember, oktaUser }) => {
emplid: serviceMember?.emplid || '',
};
- const handleBack = () => {
- navigate(customerRoutes.CONUS_OCONUS_PATH);
- };
-
const handleNext = () => {
navigate(customerRoutes.NAME_PATH);
};
@@ -73,7 +69,7 @@ export const DodInfo = ({ updateServiceMember, serviceMember, oktaUser }) => {
-
+
diff --git a/src/pages/MyMove/Profile/DodInfo.test.jsx b/src/pages/MyMove/Profile/DodInfo.test.jsx
index efd049b5632..7c044c2ad5c 100644
--- a/src/pages/MyMove/Profile/DodInfo.test.jsx
+++ b/src/pages/MyMove/Profile/DodInfo.test.jsx
@@ -38,18 +38,6 @@ describe('DodInfo page', () => {
});
});
- it('back button goes to the CONUS/OCONUS step', async () => {
- const { queryByText } = render();
-
- const backButton = queryByText('Back');
- await waitFor(() => {
- expect(backButton).toBeInTheDocument();
- });
-
- await userEvent.click(backButton);
- expect(mockNavigate).toHaveBeenCalledWith('/service-member/conus-oconus');
- });
-
it('next button submits the form and goes to the Name step', async () => {
const testServiceMemberValues = {
id: 'testServiceMemberId',
diff --git a/src/pages/MyMove/Profile/Name.test.jsx b/src/pages/MyMove/Profile/Name.test.jsx
index b91bf41c0ff..017e0502284 100644
--- a/src/pages/MyMove/Profile/Name.test.jsx
+++ b/src/pages/MyMove/Profile/Name.test.jsx
@@ -155,7 +155,7 @@ describe('requireCustomerState Name', () => {
expect(await screen.findByRole('heading', { name: 'Name', level: 1 })).toBeInTheDocument();
- expect(mockNavigate).toHaveBeenCalledWith('/service-member/conus-oconus');
+ expect(mockNavigate).toHaveBeenCalledWith('/service-member/dod-info');
});
it('does not redirect if the current state equals the "DOD INFO COMPLETE" state', async () => {
diff --git a/src/pages/MyMove/Profile/ValidationCode.jsx b/src/pages/MyMove/Profile/ValidationCode.jsx
index 031a7dc5a1a..a7923fdb042 100644
--- a/src/pages/MyMove/Profile/ValidationCode.jsx
+++ b/src/pages/MyMove/Profile/ValidationCode.jsx
@@ -34,7 +34,7 @@ export const ValidationCode = () => {
.then((response) => {
const { parameterValue } = response.body;
if (parameterValue === body.parameterValue) {
- navigate(customerRoutes.CONUS_OCONUS_PATH);
+ navigate(customerRoutes.DOD_INFO_PATH);
} else {
setValidationError('Please try again');
}
diff --git a/src/pages/MyMove/Profile/ValidationCode.test.jsx b/src/pages/MyMove/Profile/ValidationCode.test.jsx
index 07d81bff6e3..61a0a0fb6a7 100644
--- a/src/pages/MyMove/Profile/ValidationCode.test.jsx
+++ b/src/pages/MyMove/Profile/ValidationCode.test.jsx
@@ -54,7 +54,7 @@ describe('ValidationCode', () => {
expect(nextBtn).toBeEnabled();
await userEvent.click(nextBtn);
- expect(mockNavigate).toHaveBeenCalledWith(customerRoutes.CONUS_OCONUS_PATH);
+ expect(mockNavigate).toHaveBeenCalledWith(customerRoutes.DOD_INFO_PATH);
});
test('it displays error when code is not correct', async () => {
diff --git a/src/scenes/MyMove/getWorkflowRoutes.jsx b/src/scenes/MyMove/getWorkflowRoutes.jsx
index b05475b8fc1..a6b43df5448 100644
--- a/src/scenes/MyMove/getWorkflowRoutes.jsx
+++ b/src/scenes/MyMove/getWorkflowRoutes.jsx
@@ -8,7 +8,6 @@ import { NULL_UUID } from 'shared/constants';
import BackupContact from 'pages/MyMove/Profile/BackupContact';
import ProfileReview from 'scenes/Review/ProfileReview';
import Home from 'pages/MyMove/Home';
-import ConusOrNot from 'pages/MyMove/ConusOrNot';
import DodInfo from 'pages/MyMove/Profile/DodInfo';
import SMName from 'pages/MyMove/Profile/Name';
import ContactInfo from 'pages/MyMove/Profile/ContactInfo';
@@ -43,11 +42,6 @@ const pages = {
isComplete: ({ sm }) => sm.is_profile_complete || every([sm.edipi, sm.affiliation]),
render: () => ,
},
- [customerRoutes.CONUS_OCONUS_PATH]: {
- isInFlow: inGhcFlow,
- isComplete: ({ sm }) => sm.is_profile_complete || every([sm.edipi, sm.affiliation]),
- render: () => ,
- },
[customerRoutes.DOD_INFO_PATH]: {
isInFlow: myFirstRodeo,
isComplete: ({ sm }) => sm.is_profile_complete || every([sm.edipi, sm.affiliation]),
diff --git a/src/scenes/MyMove/getWorkflowRoutes.test.js b/src/scenes/MyMove/getWorkflowRoutes.test.js
index 5c865df5b10..9b4a15f11c0 100644
--- a/src/scenes/MyMove/getWorkflowRoutes.test.js
+++ b/src/scenes/MyMove/getWorkflowRoutes.test.js
@@ -101,7 +101,6 @@ describe('when getting the routes for the current workflow', () => {
it('getPagesInFlow returns service member, order and move pages', () => {
expect(pages).toEqual([
'/service-member/validation-code',
- '/service-member/conus-oconus',
'/service-member/dod-info',
'/service-member/name',
'/service-member/contact-info',
diff --git a/src/utils/customer.js b/src/utils/customer.js
index af84bb80de7..0a2b238b4f0 100644
--- a/src/utils/customer.js
+++ b/src/utils/customer.js
@@ -8,7 +8,7 @@ export const findNextServiceMemberStep = (profileState) => {
case profileStates.VALIDATION_REQUIRED:
return customerRoutes.VALIDATION_CODE_PATH;
case profileStates.EMPTY_PROFILE:
- return customerRoutes.CONUS_OCONUS_PATH;
+ return customerRoutes.DOD_INFO_PATH;
case profileStates.DOD_INFO_COMPLETE:
return customerRoutes.NAME_PATH;
case profileStates.NAME_COMPLETE: