Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INT-B-21115 #13819

Merged
merged 8 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions playwright/tests/my/mymove/onboarding.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
Expand Down Expand Up @@ -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' });
Expand Down
9 changes: 2 additions & 7 deletions src/components/Customer/DodInfoForm/DodInfoForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -104,11 +104,7 @@ const DodInfoForm = ({ initialValues, onSubmit, onBack }) => {
</SectionWrapper>

<div className={formStyles.formActions}>
<WizardNavigation
onBackClick={onBack}
disableNext={!isValid || isSubmitting}
onNextClick={handleSubmit}
/>
<WizardNavigation disableNext={!isValid || isSubmitting} onNextClick={handleSubmit} isFirstPage />
</div>
</Form>
);
Expand All @@ -123,7 +119,6 @@ DodInfoForm.propTypes = {
edipi: PropTypes.string,
}).isRequired,
onSubmit: PropTypes.func.isRequired,
onBack: PropTypes.func.isRequired,
};

export default DodInfoForm;
11 changes: 0 additions & 11 deletions src/components/Customer/DodInfoForm/DodInfoForm.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,6 @@ describe('DodInfoForm component', () => {
});
});

it('implements the onBack handler when the Back button is clicked', async () => {
const { getByRole } = render(<DodInfoForm {...testProps} />);
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(<DodInfoForm {...coastGuardTestProps} />);
Expand Down
1 change: 0 additions & 1 deletion src/constants/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
106 changes: 0 additions & 106 deletions src/pages/MyMove/ConusOrNot.jsx

This file was deleted.

33 changes: 0 additions & 33 deletions src/pages/MyMove/ConusOrNot.test.jsx

This file was deleted.

6 changes: 1 addition & 5 deletions src/pages/MyMove/Profile/DodInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down Expand Up @@ -73,7 +69,7 @@ export const DodInfo = ({ updateServiceMember, serviceMember, oktaUser }) => {

<Grid row>
<Grid col desktop={{ col: 8, offset: 2 }}>
<DodInfoForm initialValues={initialValues} onSubmit={handleSubmit} onBack={handleBack} />
<DodInfoForm initialValues={initialValues} onSubmit={handleSubmit} />
</Grid>
</Grid>
</GridContainer>
Expand Down
12 changes: 0 additions & 12 deletions src/pages/MyMove/Profile/DodInfo.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ describe('DodInfo page', () => {
});
});

it('back button goes to the CONUS/OCONUS step', async () => {
const { queryByText } = render(<DodInfo {...testProps} />);

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',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MyMove/Profile/Name.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MyMove/Profile/ValidationCode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MyMove/Profile/ValidationCode.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
6 changes: 0 additions & 6 deletions src/scenes/MyMove/getWorkflowRoutes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -43,11 +42,6 @@ const pages = {
isComplete: ({ sm }) => sm.is_profile_complete || every([sm.edipi, sm.affiliation]),
render: () => <ValidationCode />,
},
[customerRoutes.CONUS_OCONUS_PATH]: {
isInFlow: inGhcFlow,
isComplete: ({ sm }) => sm.is_profile_complete || every([sm.edipi, sm.affiliation]),
render: () => <ConusOrNot />,
},
[customerRoutes.DOD_INFO_PATH]: {
isInFlow: myFirstRodeo,
isComplete: ({ sm }) => sm.is_profile_complete || every([sm.edipi, sm.affiliation]),
Expand Down
1 change: 0 additions & 1 deletion src/scenes/MyMove/getWorkflowRoutes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/utils/customer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down