From 895c8878d3e1f546c7e4901d12d8f862ddac804d Mon Sep 17 00:00:00 2001 From: loganwc Date: Mon, 16 Sep 2024 16:07:16 +0000 Subject: [PATCH 1/5] mostly removed conus/oconus references --- src/constants/routes.js | 1 - src/pages/MyMove/Profile/DodInfo.jsx | 3 ++- src/pages/MyMove/Profile/ValidationCode.jsx | 2 +- src/scenes/MyMove/getWorkflowRoutes.jsx | 6 ------ src/utils/customer.js | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/constants/routes.js b/src/constants/routes.js index f026fee8296..ef24f03bd13 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/pages/MyMove/Profile/DodInfo.jsx b/src/pages/MyMove/Profile/DodInfo.jsx index 51f58b3f31c..adad135e2c7 100644 --- a/src/pages/MyMove/Profile/DodInfo.jsx +++ b/src/pages/MyMove/Profile/DodInfo.jsx @@ -25,7 +25,8 @@ export const DodInfo = ({ updateServiceMember, serviceMember, oktaUser }) => { }; const handleBack = () => { - navigate(customerRoutes.CONUS_OCONUS_PATH); + // if multimove go back to multimoves home page otherwise do nothing + // navigate(customerRoutes.CONUS_OCONUS_PATH); }; const handleNext = () => { 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/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/utils/customer.js b/src/utils/customer.js index b8d54cf2b0a..3fa4979927c 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: From 478bfbbd6cc149aec73c412af86e3e1987de7540 Mon Sep 17 00:00:00 2001 From: loganwc Date: Tue, 1 Oct 2024 19:15:47 +0000 Subject: [PATCH 2/5] removed ConusOrNot and it's references --- .../requireCustomerState.test.jsx | 2 +- src/pages/MyMove/ConusOrNot.jsx | 106 ------------------ src/pages/MyMove/ConusOrNot.test.jsx | 33 ------ src/pages/MyMove/Profile/DodInfo.jsx | 7 +- src/pages/MyMove/Profile/DodInfo.test.jsx | 12 -- src/pages/MyMove/Profile/Name.test.jsx | 2 +- .../MyMove/Profile/ValidationCode.test.jsx | 2 +- src/scenes/MyMove/getWorkflowRoutes.test.js | 1 - 8 files changed, 4 insertions(+), 161 deletions(-) delete mode 100644 src/pages/MyMove/ConusOrNot.jsx delete mode 100644 src/pages/MyMove/ConusOrNot.test.jsx 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 ( -
-

Where are you moving?

- - { - setLocation(e.target.value); - setlocationValue(e.target.value); - }} - name="conusStatus" - checked={conusStatus === CONUS_STATUS.CONUS} - cardText="Starts and ends in the continental US" - /> - { - setLocation(e.target.value); - setlocationValue(e.target.value); - }} - name="conusStatus" - checked={conusStatus === CONUS_STATUS.OCONUS} - disabled - cardText={oconusCardText} - /> - -
- -
-
- ); - }} -
-
-
-
- ); -}; - -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 adad135e2c7..704e589149d 100644 --- a/src/pages/MyMove/Profile/DodInfo.jsx +++ b/src/pages/MyMove/Profile/DodInfo.jsx @@ -24,11 +24,6 @@ export const DodInfo = ({ updateServiceMember, serviceMember, oktaUser }) => { emplid: serviceMember?.emplid || '', }; - const handleBack = () => { - // if multimove go back to multimoves home page otherwise do nothing - // navigate(customerRoutes.CONUS_OCONUS_PATH); - }; - const handleNext = () => { navigate(customerRoutes.NAME_PATH); }; @@ -74,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.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.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', From d0ee44124c2bed5bdf69b51faabe5ab62bb0c82d Mon Sep 17 00:00:00 2001 From: loganwc Date: Wed, 2 Oct 2024 13:44:18 +0000 Subject: [PATCH 3/5] removed back button from dod info page --- src/components/Customer/DodInfoForm/DodInfoForm.jsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/Customer/DodInfoForm/DodInfoForm.jsx b/src/components/Customer/DodInfoForm/DodInfoForm.jsx index ff084d19dfa..07cd6de02ea 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); @@ -101,11 +101,7 @@ const DodInfoForm = ({ initialValues, onSubmit, onBack }) => {
- +
); @@ -120,7 +116,6 @@ DodInfoForm.propTypes = { edipi: PropTypes.string, }).isRequired, onSubmit: PropTypes.func.isRequired, - onBack: PropTypes.func.isRequired, }; export default DodInfoForm; From 1682881a8e04a50d789fbb525fce0588fe64d06b Mon Sep 17 00:00:00 2001 From: loganwc Date: Wed, 2 Oct 2024 14:26:29 +0000 Subject: [PATCH 4/5] fixed test for thing that's not even there --- .../Customer/DodInfoForm/DodInfoForm.test.jsx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/components/Customer/DodInfoForm/DodInfoForm.test.jsx b/src/components/Customer/DodInfoForm/DodInfoForm.test.jsx index a5d1647ba99..95e0a81fa40 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, getAllByText, getByLabelText } = render(); From 2b5bec8e3a88ed3a0997d51f2ea4534068771194 Mon Sep 17 00:00:00 2001 From: loganwc Date: Wed, 2 Oct 2024 14:29:32 +0000 Subject: [PATCH 5/5] removed conus reference in playwright test --- playwright/tests/my/mymove/onboarding.spec.js | 10 ---------- 1 file changed, 10 deletions(-) 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' });