Answer a series of questions to get customized step-by-step
instructions on how to apply for a discharge upgrade or correction.
- If your application goes through and your discharge is upgraded,
- you’ll be eligible for the VA benefits you earned during your period
- of service.
+ If we accept your application and upgrade your discharge, you’ll be
+ eligible for the VA benefits you earned during your period of
+ service.
- Even with a less than honorable discharge, you may be able to
- access some VA benefits through the Character of Discharge review
- process. When you apply for VA benefits, we’ll review your record
- to determine if your service was “honorable for VA purposes.” This
- review can take up to a year. Please provide us with documents
- supporting your case, similar to the evidence you’d send with an
- application to upgrade your discharge.
-
-
- You may want to consider finding someone to advocate on your
- behalf, depending on the complexity of your case. A lawyer or
- Veterans Service Organization (VSO) can collect and submit
- supporting documents for you.{' '}
-
-
-
- Note: You can ask for a VA Character of Discharge
- review while at the same time applying for a discharge upgrade
- from the Department of Defense (DoD) or the Coast Guard.
-
-
- If you need mental health services related to PTSD or other mental
- health problems linked to your service (including conditions
- related to an experience of military sexual trauma), you may
- qualify for VA health benefits right away, even without a VA
- Character of Discharge review or a discharge upgrade.
-
-
Learn more about:
-
-
-
-
-
-
-
-
-
-
-
-
+
If your previous upgrade application was denied, you can apply
@@ -133,8 +81,8 @@ const HomePage = ({ router, setIntroPageViewed }) => {
Applying again is most likely to be successful if your application
is significantly different from when you last applied. For
example, you may have additional evidence that wasn’t available to
- you when you last applied, or the Department of Defense (DoD) may
- have issued new rules regarding discharges. DoD rules changed for
+ you when you last applied, or the Department of Defense (DOD) may
+ have issued new rules regarding discharges. DOD rules changed for
discharges related to PTSD, TBI, and mental health in 2014,
military sexual harassment and assault in 2017, and sexual
orientation in 2011.
@@ -142,7 +90,7 @@ const HomePage = ({ router, setIntroPageViewed }) => {
- If the Department of Defense (DoD) or the Coast Guard determined
+ If the Department of Defense (DOD) or the Coast Guard determined
you served honorably in one period of service, you may use that
honorable characterization to establish eligibility for VA
benefits, even if you later received a less than honorable
@@ -174,7 +122,7 @@ const HomePage = ({ router, setIntroPageViewed }) => {
to confirm your eligibility.
- You can also apply to the Department of Defense (DoD) or the Coast
+ You can also apply to the Department of Defense (DOD) or the Coast
Guard for a second DD214 only for that honorable period of
service. Select the Get Started link above and
answer the questions based on your most recent discharge. When
@@ -186,9 +134,9 @@ const HomePage = ({ router, setIntroPageViewed }) => {
- When the Department of Defense (DoD) or the Coast Guard upgrades a
+ When the Department of Defense (DOD) or the Coast Guard upgrades a
Veteran’s discharge, it usually issues a DD215 showing corrections
- to the DD214. The DoD or the Coast Guard attaches the DD215 to the
+ to the DD214. The DOD or the Coast Guard attaches the DD215 to the
old DD214—which still shows the outdated discharge and related
information. While the discharge on the DD215 is the correct
discharge, a Veteran may still want a new DD214 that shows no
diff --git a/src/applications/discharge-wizard/components/v2/RequestDD214.jsx b/src/applications/discharge-wizard/components/v2/RequestDD214.jsx
index 8383fa0ee238..7258c3e7baff 100644
--- a/src/applications/discharge-wizard/components/v2/RequestDD214.jsx
+++ b/src/applications/discharge-wizard/components/v2/RequestDD214.jsx
@@ -41,14 +41,14 @@ const RequestDD214v2 = ({ router, formResponses, viewedIntroPage }) => {
To receive a second DD214 reflecting only your
period of honorable service, you’ll need to complete Department of
- Defense (DoD) Form 149 and send it to the {name}—
+ Defense (DOD) Form 149 and send it to the {name}—
do not send it to the Discharge Review Board (DRB)
for the {branchOfService}.
diff --git a/src/applications/discharge-wizard/components/v2/ResultsPage.jsx b/src/applications/discharge-wizard/components/v2/ResultsPage.jsx
index 4e06899aafdf..821ad3635597 100644
--- a/src/applications/discharge-wizard/components/v2/ResultsPage.jsx
+++ b/src/applications/discharge-wizard/components/v2/ResultsPage.jsx
@@ -8,7 +8,6 @@ import { ROUTES } from '../../constants';
import ResultsSummary from './resultsComponents/ResultsSummary';
import CarefulConsiderationStatement from './resultsComponents/CarefulConsiderationStatement';
import Warnings from './resultsComponents/Warnings';
-import OptionalStep from './resultsComponents/OptionalStep';
import StepOne from './resultsComponents/StepOne';
import AdditionalInstructions from './resultsComponents/AdditionalInstructions';
import StepTwo from './resultsComponents/StepTwo';
@@ -43,7 +42,6 @@ const ResultsPage = ({ formResponses, router, viewedIntroPage }) => {
router={router}
/>
-
diff --git a/src/applications/discharge-wizard/components/v2/VABenefitsAccordion.jsx b/src/applications/discharge-wizard/components/v2/VABenefitsAccordion.jsx
new file mode 100644
index 000000000000..b0bf9041fae1
--- /dev/null
+++ b/src/applications/discharge-wizard/components/v2/VABenefitsAccordion.jsx
@@ -0,0 +1,99 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+
+const VABenefitsAccordion = ({ isResultsPage = false }) => {
+ const links = [
+ {
+ text:
+ 'VA health benefits for Veterans who’ve experienced military sexual trauma',
+ href: '/health-care/health-needs-conditions/military-sexual-trauma/',
+ },
+ {
+ text: 'VA health benefits for Veterans with mental health conditions',
+ href: '/health-care/health-needs-conditions/mental-health/',
+ },
+ {
+ text: 'VA health benefits for Veterans with PTSD',
+ href: '/health-care/health-needs-conditions/mental-health/ptsd/',
+ },
+ ];
+
+ let learnMoreLinks = (
+
+ Even with a less than honorable discharge, you may be able to access
+ some VA benefits through the Character of Discharge review process. When
+ you apply for VA benefits, we’ll review your record to determine if your
+ service was “honorable for VA purposes.” This review can take up to a
+ year. Provide us with documents supporting your case, similar to the
+ evidence you’d send with an application to upgrade your discharge.
+
+
+ An accredited attorney, claims agent, or Veterans Service Organization
+ (VSO) representative can help you gather your evidence and submit your
+ application. {vsoLink}.
+
+
+ Note: You can ask for a VA Character of Discharge
+ review while at the same time applying for a discharge upgrade from the
+ Department of Defense (DOD) or the Coast Guard.
+
+
+ If you experienced sexual assault or harassment while in the military,
+ or need mental health services related to PTSD or other mental health
+ conditions linked to your service, you may qualify immediately for VA
+ health benefits, even without a VA Character of Discharge review or a
+ discharge upgrade.
+
- Even with a less than honorable discharge, you may be able to access
- some VA benefits through the Character of Discharge review process.
- When you apply for VA benefits, we’ll review your record to
- determine if your service was “honorable for VA purposes.” This
- review can take up to a year. Please provide us with documents
- supporting your case, similar to the evidence you’d send with an
- application to upgrade your discharge.
-
-
- You may want to consider finding someone to advocate on your behalf,
- depending on the complexity of your case. A lawyer or Veterans
- Service Organization (VSO) can collect and submit supporting
- documents for you.{' '}
-
- Find a VSO near you (opens in a new tab).
-
-
-
- Note: You can ask for a VA Character of Discharge
- review while at the same time applying for a discharge upgrade from
- the Department of Defense (DoD) or the Coast Guard.
-
-
- If you experienced sexual assault or harassment while in the
- military, or need mental health services related to PTSD or other
- mental health conditions linked to your service, you may qualify
- immediately for VA health benefits, even without a VA Character of
- Discharge review or a discharge upgrade.
-
- Please note: This information was created based on how
- you answered the questions on the previous page. This information will
- not be specific to someone with different answers to the questions.
+ Note: This information was created based on how you
+ answered the questions on the previous page. This information will not
+ be specific to someone with different answers to the questions.
Because you answered that your discharge was related to
posttraumatic stress disorder (PTSD) or other mental health
- conditions, the DoD will apply “liberal consideration” to your case.
- In 2014, the DoD recognized that many Veterans had received
+ conditions, the DOD will apply “liberal consideration” to your case.
+ In 2014, the DOD recognized that many Veterans had received
discharges due to behavior connected to their previously undiagnosed
or undocumented PTSD or mental health condition.
Because you answered that your discharge was related to a traumatic
- brain injury (TBI), the DoD will apply “liberal consideration” to
- your case. In 2014, the DoD recognized that many Veterans had
+ brain injury (TBI), the DOD will apply “liberal consideration” to
+ your case. In 2014, the DOD recognized that many Veterans had
received discharges due to behavior connected to their previously
undiagnosed or undocumented TBI.
Because you answered that your discharge was due to your sexual
- orientation, the DoD encourages you to apply for an upgrade. In
- 2011, the DoD recognized that many Veterans received discharges
+ orientation, the DOD encourages you to apply for an upgrade. In
+ 2011, the DOD recognized that many Veterans received discharges
only because of their sexual orientation. {' '}
Note: You must prove that your discharge was
solely due to your sexual orientation and events specifically
@@ -65,8 +65,8 @@ const CarefulConsiderationStatement = ({ formResponses, router }) => {
return (
Because you answered that your discharge was related to sexual
- assault or harassment, the DoD will apply “liberal consideration” to
- your case. In 2017, the DoD recognized that many Veterans had
+ assault or harassment, the DOD will apply “liberal consideration” to
+ your case. In 2017, the DOD recognized that many Veterans had
received discharges due to sexual assault or harassment, and had
unfairly received less than honorable discharges.{' '}
Note: You must prove that your discharge was solely
diff --git a/src/applications/discharge-wizard/components/v2/resultsComponents/OptionalStep.jsx b/src/applications/discharge-wizard/components/v2/resultsComponents/OptionalStep.jsx
deleted file mode 100644
index 494358585c93..000000000000
--- a/src/applications/discharge-wizard/components/v2/resultsComponents/OptionalStep.jsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-
-import {
- SHORT_NAME_MAP,
- RESPONSES,
-} from '../../../constants/question-data-map';
-
-const OptionalStep = ({ formResponses }) => {
- const validReason = [RESPONSES.REASON_PTSD, RESPONSES.REASON_TBI].includes(
- formResponses[SHORT_NAME_MAP.REASON],
- );
- const dischargeYear = parseInt(
- formResponses[SHORT_NAME_MAP.DISCHARGE_YEAR],
- 10,
- );
- const validYear = dischargeYear >= 2001 && dischargeYear <= 2009;
-
- if (validReason && validYear) {
- return (
-
-
-
- (Optional): Apply to the Physical Disability Board of Review (PDBR)
-
-
- If you believe your disability rating for TBI, PTSD, or mental
- health conditions is too low, consider applying to the Physical
- Disability Board of Review (PDBR). The DoD created the PDBR
- specifically to review appeals about low disability ratings for
- Veterans discharged between 2001 and 2009. Some Veterans discharged
- during this period of time received lower disability ratings than
- they deserved, especially if they suffered from TBI, PTSD, or other
- mental health conditions. If you were discharged during this period
- of time and previously received a disability rating of 20% or lower,
- you’re eligible to apply to the PDBR for review. The PDBR does not
- issue discharge upgrades and cannot review conditions not listed in
- your military record before your separation. But, if the PDBR finds
- that your disability rating was unjustly low, it may help you make
- your case to upgrade your discharge.{' '}
-
- Learn more about PBDR reviews (opens in a new tab)
-
- .{' '}
-
- Apply for a PBDR review (opens in a new tab)
-
- .
-
-
-
- );
- }
- return null;
-};
-
-OptionalStep.propTypes = {
- formResponses: PropTypes.object.isRequired,
-};
-
-export default OptionalStep;
diff --git a/src/applications/discharge-wizard/components/v2/resultsComponents/ResultsSummary.jsx b/src/applications/discharge-wizard/components/v2/resultsComponents/ResultsSummary.jsx
index 2a2fe515bf09..d214c9bd4998 100644
--- a/src/applications/discharge-wizard/components/v2/resultsComponents/ResultsSummary.jsx
+++ b/src/applications/discharge-wizard/components/v2/resultsComponents/ResultsSummary.jsx
@@ -24,22 +24,28 @@ const ResultsSummary = ({ formResponses }) => {
const airForceAFRBAPortal = determineAirForceAFRBAPortal(formResponses);
- const formNumber = determineFormData(formResponses).num;
+ const formData = determineFormData(formResponses);
const dischargeBoard = determineBoardObj(formResponses).name;
const serviceBranch = formResponses[SHORT_NAME_MAP.SERVICE_BRANCH];
const isReconsideration = forReconsideration ? ' for reconsideration' : '';
- let summary = `Based on your answers, you need to complete Department of Defense (DoD) Form ${formNumber} and send it to the ${dischargeBoard} for the ${determineBranchOfService(
+ const sendInstructions = `send it to the ${dischargeBoard} for the ${determineBranchOfService(
serviceBranch,
)}${isReconsideration}.`;
+ let summary = '';
+
if (airForceAFRBAPortal) {
- summary =
- 'Based on your answers, you need to complete an Application for Correction of Military Record (DD 149). You can download this form from the Air Force Review Boards Agency Website and Portal.';
+ summary = `Correction of Military Record (DD 149). You can download this form from the Air Force Review Boards Agency Website and Portal.`;
+ } else {
+ summary = `${formData?.formDescription} and ${sendInstructions}`;
}
return (
-
{summary}
+
+ Based on your answers, you’ll need to complete an Application for{' '}
+ {summary}
+
);
};
diff --git a/src/applications/discharge-wizard/components/v2/resultsComponents/StepOne.jsx b/src/applications/discharge-wizard/components/v2/resultsComponents/StepOne.jsx
index f7ccd0b4f2fe..7ed759320e59 100644
--- a/src/applications/discharge-wizard/components/v2/resultsComponents/StepOne.jsx
+++ b/src/applications/discharge-wizard/components/v2/resultsComponents/StepOne.jsx
@@ -98,7 +98,7 @@ const StepOne = ({ formResponses }) => {
Note: You’re generally only eligible for
reconsideration if you have new evidence to present that wasn’t
available when you applied last time. Make sure you’re clear about
- exactly what that new evidence is. Additionally, changes in DoD
+ exactly what that new evidence is. Additionally, changes in DOD
policy, like the new consideration guidelines for PTSD, TBI, and
sexual assault or harassment, can qualify you for reconsideration.
@@ -106,13 +106,13 @@ const StepOne = ({ formResponses }) => {
{formResponses[SHORT_NAME_MAP.REASON] ===
RESPONSES.REASON_SEXUAL_ASSAULT && (
- Note: For upgrades related to sexual assault or harassment, you do not
- need to prove the original assault or harassment occurred—meaning if
- you didn’t file charges or report the incident, you can still apply
- for an upgrade. The important part of your application is where you
- explain the impact of the incident on your service. For example,
- detail how the incident caused a decrease in your productivity, or was
- the reason for PTSD.
+ Note: For upgrades related to sexual assault or
+ harassment, you do not need to prove the original assault or
+ harassment occurred—meaning if you didn’t file charges or report the
+ incident, you can still apply for an upgrade. The important part of
+ your application is where you explain the impact of the incident on
+ your service. For example, detail how the incident caused a decrease
+ in your productivity, or was the reason for PTSD.
)}
{boardToSubmit.abbr !== DRB && (
@@ -167,12 +167,18 @@ const StepOne = ({ formResponses }) => {
);
- const form = determineFormData(formResponses);
- const header = `Download and fill out DoD Form ${form.num}`;
+ const { num: formNumber, link: formLink } = determineFormData(formResponses);
+ let formTitle = `Form ${formNumber}`;
+
+ if ([293, 149].includes(formNumber)) {
+ formTitle = `DOD Form ${formNumber}`;
+ }
+
+ const header = `Download and fill out DOD Form ${formNumber}`;
return (
-
- Need help preparing your application?
+ If you need help filling out your form
- The process of preparing a discharge upgrade or correction
- application can be a lot of work and can take a long time.
- Although many Veterans are successful on their own, you may want
- to consider finding someone to advocate for you in this process.
- Try a Veterans Service Organization (VSO), search online for a
- lawyer who may provide services for low or no cost, or ask other
- Veterans for recommendations.{' '}
+ You can appoint an accredited attorney, claims agent, or Veterans
+ Service Organization (VSO) representative.{' '}
- Find a VSO near you (opens in a new tab)
+ Get help from an accredited representative (opens in a new tab)
.
- Your last application was made before the release of DoD guidance
+ Your last application was made before the release of DOD guidance
related to discharges like yours. As a result, the Board may treat
your application as a new case. If possible, review the new
policies and state in your application how the change in policy is
diff --git a/src/applications/discharge-wizard/constants/index.js b/src/applications/discharge-wizard/constants/index.js
index d28793298c7c..a5550f8ebd1b 100644
--- a/src/applications/discharge-wizard/constants/index.js
+++ b/src/applications/discharge-wizard/constants/index.js
@@ -1,10 +1,10 @@
export const DW_UPDATE_FIELD = 'discharge-wizard/UPDATE_FIELD';
export const venueWarning =
- "You answered that you weren't sure where you applied for an upgrade before. The instructions below are for Veterans who have never applied for a discharge upgrade, so your process may be different. For more reliable information on your discharge upgrade process, please review your records to find out which board you sent your earlier application to, and complete the questions again.";
+ "You answered that you weren't sure where you applied for an upgrade before. The instructions below are for Veterans who have never applied for a discharge upgrade, so your process may be different. For more reliable information on your discharge upgrade process, review your records to find out which board you sent your earlier application to, and complete the questions again.";
export const upgradeVenueWarning =
- "You answered that you weren't sure where you applied for an upgrade before. The instructions below are for Veterans who had a successful upgrade application reviewed by the [branch of service] Discharge Review Board (DRB). For more reliable information, please review your records to find out which board you sent your earlier application to, and complete the questions again.";
+ "You answered that you weren't sure where you applied for an upgrade before. The instructions below are for Veterans who had a successful upgrade application reviewed by the [branch of service] Discharge Review Board (DRB). For more reliable information, review your records to find out which board you sent your earlier application to, and complete the questions again.";
/* eslint-disable quote-props */
export const questionLabels = {
diff --git a/src/applications/discharge-wizard/constants/question-data-map.js b/src/applications/discharge-wizard/constants/question-data-map.js
index c5936fa836c6..c032e40b9b00 100644
--- a/src/applications/discharge-wizard/constants/question-data-map.js
+++ b/src/applications/discharge-wizard/constants/question-data-map.js
@@ -3,7 +3,8 @@ export const QUESTION_MAP = Object.freeze({
SERVICE_BRANCH: 'What was your branch of service?',
DISCHARGE_YEAR: 'What year were you discharged from the military?',
DISCHARGE_MONTH: 'What month were you discharged?',
- REASON: 'Tell us why you want to change your discharge paperwork.',
+ REASON:
+ "Which of the following best describes why you want to change your discharge paperwork? Choose the one that's closest to your situation.",
DISCHARGE_TYPE: "What's your character of discharge?",
INTENTION:
'Do you want to change your name, discharge date, or something written in the "other remarks" section of your DD214?',
diff --git a/src/applications/discharge-wizard/helpers/index.jsx b/src/applications/discharge-wizard/helpers/index.jsx
index c3e9b541c469..ac2c4f26efde 100644
--- a/src/applications/discharge-wizard/helpers/index.jsx
+++ b/src/applications/discharge-wizard/helpers/index.jsx
@@ -529,15 +529,20 @@ export const determineVenueAddress = (formResponses, noDRB) => {
// Determines specific form data Veterans will need to fill out based on form responses.
export const determineFormData = formResponses => {
const boardData = determineBoardObj(formResponses);
+
if ([DRB, AFDRB].includes(boardData?.abbr)) {
return {
num: 293,
+ formDescription:
+ 'the Review of Discharge From the Armed Forces of the United States (DOD Form 293)',
link:
'http://www.esd.whs.mil/Portals/54/Documents/DD/forms/dd/dd0293.pdf',
};
}
+
return {
num: 149,
+ formDescription: 'Correction of Military Record (DOD Form 149)',
link: 'https://www.esd.whs.mil/Portals/54/Documents/DD/forms/dd/dd0149.pdf',
};
};
diff --git a/src/applications/discharge-wizard/tests/v2/helpers/index.unit.spec.js b/src/applications/discharge-wizard/tests/v2/helpers/index.unit.spec.js
index 730c4c11d8d7..2264d3422d1c 100644
--- a/src/applications/discharge-wizard/tests/v2/helpers/index.unit.spec.js
+++ b/src/applications/discharge-wizard/tests/v2/helpers/index.unit.spec.js
@@ -38,6 +38,7 @@ describe('Discharge Wizard helpers', () => {
};
const formNumber = determineFormData(formResponses);
expect(formNumber).to.deep.equal({
+ formDescription: 'Correction of Military Record (DOD Form 149)',
num: 149,
link:
'https://www.esd.whs.mil/Portals/54/Documents/DD/forms/dd/dd0149.pdf',
diff --git a/src/applications/discover-your-benefits/constants/benefits.js b/src/applications/discover-your-benefits/constants/benefits.js
index 0a3d80dd39a7..e2b10fa59bdb 100644
--- a/src/applications/discover-your-benefits/constants/benefits.js
+++ b/src/applications/discover-your-benefits/constants/benefits.js
@@ -558,7 +558,7 @@ export const BENEFITS_LIST = [
category: categories.LIFE_INSURANCE,
id: 'VAL',
description:
- "Note: You must already have a VA service-connected disability rating to be approved for Veterans Affairs Life Insurance (VALife). VALife provides low-cost coverage to Veterans with service-connected disabilities. Find out if you're eligible and how to apply",
+ "Note: You must already have a VA service-connected disability rating to be approved for Veterans Affairs Life Insurance (VALife). VALife provides low-cost coverage to Veterans with service-connected disabilities. Find out if you're eligible and how to apply.",
isTimeSensitive: false,
mappings: {
[mappingTypes.GOALS]: [goalTypes.RETIREMENT, goalTypes.UNDERSTAND],
diff --git a/src/applications/ezr/config/chapters/householdInformation/spouseContactInformation.js b/src/applications/ezr/config/chapters/householdInformation/spouseContactInformation.js
index 0eb14a8f7fa3..a06235379e98 100644
--- a/src/applications/ezr/config/chapters/householdInformation/spouseContactInformation.js
+++ b/src/applications/ezr/config/chapters/householdInformation/spouseContactInformation.js
@@ -16,7 +16,12 @@ const {
export default {
uiSchema: {
...titleUI(content['household-spouse-contact-info-title']),
- spouseAddress: addressUI({ omit: ['isMilitary'] }),
+ spouseAddress: addressUI({
+ omit: ['isMilitary'],
+ required: {
+ state: () => true,
+ },
+ }),
spousePhone: {
...phoneUI(content['household-sponse-phone-label']),
'ui:errorMessages': {
diff --git a/src/applications/ezr/config/chapters/veteranInformation/homeAddress.js b/src/applications/ezr/config/chapters/veteranInformation/homeAddress.js
index 6059ddcf80e3..b09a83658b28 100644
--- a/src/applications/ezr/config/chapters/veteranInformation/homeAddress.js
+++ b/src/applications/ezr/config/chapters/veteranInformation/homeAddress.js
@@ -15,7 +15,11 @@ const {
export default {
uiSchema: {
'view:pageTitle': titleUI(content['vet-home-address-title']),
- veteranHomeAddress: addressUI(),
+ veteranHomeAddress: addressUI({
+ required: {
+ state: () => true,
+ },
+ }),
},
schema: {
type: 'object',
diff --git a/src/applications/ezr/config/chapters/veteranInformation/mailingAddress.js b/src/applications/ezr/config/chapters/veteranInformation/mailingAddress.js
index ef4183fc4148..7114290f4852 100644
--- a/src/applications/ezr/config/chapters/veteranInformation/mailingAddress.js
+++ b/src/applications/ezr/config/chapters/veteranInformation/mailingAddress.js
@@ -23,7 +23,11 @@ export default {
content['vet-mailing-address-title'],
content['vet-mailing-address-description'],
),
- veteranAddress: addressUI(),
+ veteranAddress: addressUI({
+ required: {
+ state: () => true,
+ },
+ }),
'view:doesMailingMatchHomeAddress': yesNoUI(
content['vet-address-match-title'],
),
diff --git a/src/applications/ezr/tests/helpers.js b/src/applications/ezr/tests/helpers.js
index 65af15535236..ba5411d473b3 100644
--- a/src/applications/ezr/tests/helpers.js
+++ b/src/applications/ezr/tests/helpers.js
@@ -1,4 +1,8 @@
+import React from 'react';
import ReactTestUtils from 'react-dom/test-utils';
+import { expect } from 'chai';
+import { render } from '@testing-library/react';
+import { DefinitionTester } from 'platform/testing/unit/schemaform-utils';
// simulate v1 forms library input change
export const simulateInputChange = (formDOM, querySelectorElement, value) => {
@@ -22,3 +26,35 @@ export const inputVaTextInput = (selector, value) => {
});
vaTextInput.dispatchEvent(event);
};
+
+/*
+Check to ensure that the address state field is required for non-US countries. It
+must be present in order to pass Enrollment System validation.
+ */
+export const expectStateInputToBeRequired = (
+ schema,
+ uiSchema,
+ definitions,
+ countryFieldName,
+ stateFieldName,
+) => {
+ const { container } = render(
+ ,
+ );
+
+ const country = container.querySelector(`[name="root_${countryFieldName}"]`);
+ const state = container.querySelector(`[name="root_${stateFieldName}"]`);
+
+ country.__events.vaSelect({
+ target: {
+ name: `root_${countryFieldName}`,
+ value: 'CAN',
+ },
+ });
+
+ expect(state).to.have.attr('required', 'true');
+};
diff --git a/src/applications/ezr/tests/unit/config/householdInformation/spouseContactInformation.unit.spec.js b/src/applications/ezr/tests/unit/config/householdInformation/spouseContactInformation.unit.spec.js
index d40ab73fac32..ef293e4d8d26 100644
--- a/src/applications/ezr/tests/unit/config/householdInformation/spouseContactInformation.unit.spec.js
+++ b/src/applications/ezr/tests/unit/config/householdInformation/spouseContactInformation.unit.spec.js
@@ -3,6 +3,7 @@ import {
testNumberOfWebComponentFields,
} from '../helpers.spec';
import formConfig from '../../../../config/form';
+import { expectStateInputToBeRequired } from '../../../helpers';
const {
chapters: {
@@ -24,7 +25,7 @@ testNumberOfWebComponentFields(
);
// run test for correct number of error messages on submit
-const expectedNumberOfErrors = 4;
+const expectedNumberOfErrors = 5;
testNumberOfErrorsOnSubmitForWebComponents(
formConfig,
schema,
@@ -32,3 +33,17 @@ testNumberOfErrorsOnSubmitForWebComponents(
expectedNumberOfErrors,
pageTitle,
);
+
+describe('ezr VeteranHomeAddress config', () => {
+ const { defaultDefinitions: definitions } = formConfig;
+
+ it('if the country selected is not the United States, the state field is still required', async () => {
+ expectStateInputToBeRequired(
+ schema,
+ uiSchema,
+ definitions,
+ 'spouseAddress_country',
+ 'spouseAddress_state',
+ );
+ });
+});
diff --git a/src/applications/ezr/tests/unit/config/veteranInformation/homeAddress.unit.spec.js b/src/applications/ezr/tests/unit/config/veteranInformation/homeAddress.unit.spec.js
index 6b23a9fdfc53..40712e9d71e1 100644
--- a/src/applications/ezr/tests/unit/config/veteranInformation/homeAddress.unit.spec.js
+++ b/src/applications/ezr/tests/unit/config/veteranInformation/homeAddress.unit.spec.js
@@ -3,6 +3,7 @@ import {
testNumberOfWebComponentFields,
} from '../helpers.spec';
import formConfig from '../../../../config/form';
+import { expectStateInputToBeRequired } from '../../../helpers';
const {
chapters: {
@@ -24,7 +25,7 @@ testNumberOfWebComponentFields(
);
// run test for correct number of error messages on submit
-const expectedNumberOfWebComponentErrors = 4;
+const expectedNumberOfWebComponentErrors = 5;
testNumberOfErrorsOnSubmitForWebComponents(
formConfig,
schema,
@@ -32,3 +33,17 @@ testNumberOfErrorsOnSubmitForWebComponents(
expectedNumberOfWebComponentErrors,
pageTitle,
);
+
+describe('ezr VeteranHomeAddress config', () => {
+ const { defaultDefinitions: definitions } = formConfig;
+
+ it('if the country selected is not the United States, the state field is still required', async () => {
+ expectStateInputToBeRequired(
+ schema,
+ uiSchema,
+ definitions,
+ 'veteranHomeAddress_country',
+ 'veteranHomeAddress_state',
+ );
+ });
+});
diff --git a/src/applications/ezr/tests/unit/config/veteranInformation/mailingAddress.unit.spec.js b/src/applications/ezr/tests/unit/config/veteranInformation/mailingAddress.unit.spec.js
index 5e92aa36d43e..f873aea70148 100644
--- a/src/applications/ezr/tests/unit/config/veteranInformation/mailingAddress.unit.spec.js
+++ b/src/applications/ezr/tests/unit/config/veteranInformation/mailingAddress.unit.spec.js
@@ -1,8 +1,9 @@
+import formConfig from '../../../../config/form';
import {
testNumberOfErrorsOnSubmitForWebComponents,
testNumberOfWebComponentFields,
} from '../helpers.spec';
-import formConfig from '../../../../config/form';
+import { expectStateInputToBeRequired } from '../../../helpers';
const {
chapters: {
@@ -24,7 +25,7 @@ testNumberOfWebComponentFields(
);
// run test for correct number of error messages on submit
-const expectedNumberOfWebComponentErrors = 5;
+const expectedNumberOfWebComponentErrors = 6;
testNumberOfErrorsOnSubmitForWebComponents(
formConfig,
schema,
@@ -32,3 +33,17 @@ testNumberOfErrorsOnSubmitForWebComponents(
expectedNumberOfWebComponentErrors,
pageTitle,
);
+
+describe('ezr VeteranMailingAddress config', () => {
+ const { defaultDefinitions: definitions } = formConfig;
+
+ it('if the country selected is not the United States, the state field is still required', async () => {
+ expectStateInputToBeRequired(
+ schema,
+ uiSchema,
+ definitions,
+ 'veteranAddress_country',
+ 'veteranAddress_state',
+ );
+ });
+});
diff --git a/src/applications/facility-locator/components/search-results-items/common/LocationPhoneLink.jsx b/src/applications/facility-locator/components/search-results-items/common/LocationPhoneLink.jsx
index 9572f638f114..d077d125485b 100644
--- a/src/applications/facility-locator/components/search-results-items/common/LocationPhoneLink.jsx
+++ b/src/applications/facility-locator/components/search-results-items/common/LocationPhoneLink.jsx
@@ -15,8 +15,13 @@ export const renderPhoneNumber = (
return null;
}
- const { formattedPhoneNumber, extension, contact } = parsePhoneNumber(phone);
-
+ const {
+ extension,
+ contact,
+ processed,
+ international,
+ countryCode,
+ } = parsePhoneNumber(phone);
// The Telephone component will throw an error if passed an invalid phone number.
// Since we can't use try/catch or componentDidCatch here, we'll just do this:
if (contact.length !== 10) {
@@ -30,17 +35,23 @@ export const renderPhoneNumber = (
{from === 'FacilityDetail' && }
{title && {title}: }
{subTitle}
-
- {formattedPhoneNumber}
-
+ {processed ? (
+
+ ) : (
+ // eslint-disable-next-line @department-of-veterans-affairs/prefer-telephone-component
+
+ {contact}
+
+ )}
);
};
diff --git a/src/applications/facility-locator/tests/components/search-results/common/Covid19PhoneLink.unit.spec.jsx b/src/applications/facility-locator/tests/components/search-results/common/Covid19PhoneLink.unit.spec.jsx
index 47a3df935049..42a3bc130c78 100644
--- a/src/applications/facility-locator/tests/components/search-results/common/Covid19PhoneLink.unit.spec.jsx
+++ b/src/applications/facility-locator/tests/components/search-results/common/Covid19PhoneLink.unit.spec.jsx
@@ -16,7 +16,7 @@ describe('Covid19PhoneLink', () => {
.trim(),
).to.equal('Call to schedule:');
expect(wrapper.find('va-telephone').html()).to.equal(
- '',
+ '',
);
wrapper.unmount();
});
diff --git a/src/applications/facility-locator/tests/helpers/phoneNumbers.unit.spec.js b/src/applications/facility-locator/tests/helpers/phoneNumbers.unit.spec.js
index ae107f8dafac..7a3cba06ce36 100644
--- a/src/applications/facility-locator/tests/helpers/phoneNumbers.unit.spec.js
+++ b/src/applications/facility-locator/tests/helpers/phoneNumbers.unit.spec.js
@@ -4,51 +4,129 @@ import { parsePhoneNumber } from '../../utils/phoneNumbers';
describe('parsePhoneNumber', () => {
it('without extension, without dashes', () => {
const phone = '1234567890';
- const { formattedPhoneNumber, extension, contact } = parsePhoneNumber(
- phone,
- );
- expect(formattedPhoneNumber).to.equal('123-456-7890');
- expect(extension).to.equal('');
+ const {
+ contact,
+ extension,
+ processed,
+ international,
+ countryCode,
+ } = parsePhoneNumber(phone);
+ expect(processed).to.equal(true);
+ expect(extension).to.equal(undefined);
expect(contact).to.equal('1234567890');
+ expect(international).to.equal(false);
+ expect(countryCode).to.equal(undefined);
});
it('with extension, without dashes', () => {
const phone = '1234567890 x123';
- const { formattedPhoneNumber, extension, contact } = parsePhoneNumber(
- phone,
- );
- expect(formattedPhoneNumber).to.equal('123-456-7890 x123');
+ const {
+ contact,
+ extension,
+ processed,
+ international,
+ countryCode,
+ } = parsePhoneNumber(phone);
expect(extension).to.equal('123');
expect(contact).to.equal('1234567890');
+ expect(processed).to.equal(true);
+ expect(international).to.equal(false);
+ expect(countryCode).to.equal(undefined);
});
it('with dashes', () => {
const phone = '123-456--7890';
- const { formattedPhoneNumber, extension, contact } = parsePhoneNumber(
- phone,
- );
- expect(formattedPhoneNumber).to.equal('123-456-7890');
- expect(extension).to.equal('');
+ const {
+ contact,
+ extension,
+ processed,
+ international,
+ countryCode,
+ } = parsePhoneNumber(phone);
+ expect(extension).to.equal(undefined);
expect(contact).to.equal('1234567890');
+ expect(processed).to.equal(true);
+ expect(international).to.equal(false);
+ expect(countryCode).to.equal(undefined);
});
it('with spaces and extension', () => {
const phone = '123 456 7890 Extension 123';
- const { formattedPhoneNumber, extension, contact } = parsePhoneNumber(
- phone,
- );
- expect(formattedPhoneNumber).to.equal('123-456-7890 x123');
+ const {
+ contact,
+ extension,
+ processed,
+ international,
+ countryCode,
+ } = parsePhoneNumber(phone);
expect(extension).to.equal('123');
expect(contact).to.equal('1234567890');
+ expect(processed).to.equal(true);
+ expect(international).to.equal(false);
+ expect(countryCode).to.equal(undefined);
});
it('with 800 numbers', () => {
const phone = '1-800-827-1000';
- const { formattedPhoneNumber, extension, contact } = parsePhoneNumber(
- phone,
- );
- expect(formattedPhoneNumber).to.equal('800-827-1000');
- expect(extension).to.equal('');
+ const {
+ processed,
+ extension,
+ contact,
+ countryCode,
+ international,
+ } = parsePhoneNumber(phone);
+ expect(extension).to.equal(undefined);
expect(contact).to.equal('8008271000');
+ expect(processed).to.equal(true);
+ expect(international).to.equal(true);
+ expect(countryCode).to.equal(undefined); // because it is 1
+ });
+
+ it('with +1-877 numbers', () => {
+ const phone = '+1-877-222-8387 ext. 123';
+ const {
+ processed,
+ extension,
+ contact,
+ countryCode,
+ international,
+ } = parsePhoneNumber(phone);
+ expect(extension).to.equal('123');
+ expect(contact).to.equal('8772228387');
+ expect(processed).to.equal(true);
+ expect(international).to.equal(true);
+ expect(countryCode).to.equal(undefined); // because it is 1
+ });
+
+ it('with +1(877) numbers', () => {
+ const phone = '+1(877) 222-8387 ext 123';
+ const {
+ processed,
+ extension,
+ contact,
+ countryCode,
+ international,
+ } = parsePhoneNumber(phone);
+ expect(extension).to.equal('123');
+ expect(contact).to.equal('8772228387');
+ expect(processed).to.equal(true);
+ expect(international).to.equal(true);
+ expect(countryCode).to.equal(undefined); // because it is 1
+ });
+
+ it('should process with extension from result', () => {
+ const phone = '573-475-4108 ext 1008';
+ const {
+ processed,
+ extension,
+ contact,
+ countryCode,
+ international,
+ } = parsePhoneNumber(phone);
+ expect(extension).to.equal('1008');
+ expect(contact).to.equal('5734754108');
+ expect(processed).to.equal(true);
+ expect(international).to.equal(false);
+ expect(countryCode).to.equal(undefined);
});
});
diff --git a/src/applications/facility-locator/utils/phoneNumbers.js b/src/applications/facility-locator/utils/phoneNumbers.js
index 7502a25869c0..7a495c95dc30 100644
--- a/src/applications/facility-locator/utils/phoneNumbers.js
+++ b/src/applications/facility-locator/utils/phoneNumbers.js
@@ -14,13 +14,48 @@
*/
export const parsePhoneNumber = phone => {
- const phoneUS = phone.replace(/^1-/, '');
- const re = /^(\d{3})[ -]*?(\d{3})[ -]*?(\d{4})\s?(\D*)?[ ]?(\d*)?/;
- const extension = phoneUS.replace(re, '$5').replace(/\D/g, '');
- const formattedPhoneNumber = extension
- ? phoneUS.replace(re, '$1-$2-$3 x$5').replace(/x$/, '')
- : phoneUS.replace(re, '$1-$2-$3');
- const contact = phoneUS.replace(re, '$1$2$3');
+ // This regex has named capture groups for the international code (optional), area code, prefix, line number, and extension.
+ // in regular expressions (?...) is a named capture group, therefore you can reference the group by its name
+ // The international code (intl) is optional. Someone may write +1 ac, +1 (ac), 1 (ac), 1-ac, 1.ac or 1ac or just ac, (ac), or ac.
+ // the intl need not be separated by space, dash or period from the ac
+ // The ac is the area code and is expected to be 3 digits exactly
+ // The pfx is the prefix and is expected to be 3 digits exactly
+ // The linenum is the line number and is expected to be 4 digits exactly
+ // ac/pfx/linenum _can_ be separated by space, dash or period or repeats of those characters
+ // The extension is optional and is expected to be a number after the required capture groups
+ // The extension is at least separated by an "x" or "ext" or "extension" or "ext." or "x." or "ext." or "extension."
+ // Since the intl group is greedy, if there is a number like +63285503888 (the Philippines VA Medical Center)
+ // it will be captured as intl=6, ac=328, pfx=550, linenum=3888 because the ac, pfx, and linenum are required to be a certain length
+ // However, if it is entered as +063285503888, it will be captured as intl=06, ac=328, pfx=550, linenum=3888
+ // This is because the intl group can expand to capture the 0, but the ac, pfx, and linenum groups are required to be a certain length
+ // Similarly if it is entered as: +01163285503888 it will be captured as intl=0116, ac=328, pfx=550, linenum=3888
+ // At some point we may wish to remove the 0 and 011 from the intl group, but it is unlikely to be entered
+ const phoneRegex = /^(?:\+?(?\d{1,}?)[ -.]*)?\(?(?\d{3})\)?[- .]*(?\d{3})[- .]*(?\d{4}),?(?: ?e?xt?e?n?s?i?o?n?\.? ?(?\d*))?$/i;
+ const match = phoneRegex.exec(phone);
- return { formattedPhoneNumber, extension, contact };
+ const errorObject = {
+ contact: phone,
+ extension: undefined,
+ processed: false,
+ international: false,
+ countryCode: '',
+ };
+
+ // must have at least match
+ if (!match) {
+ return errorObject;
+ }
+
+ const { intl, ac, pfx, linenum, ext } = match.groups;
+ if (!ac || !pfx || !linenum) {
+ return errorObject;
+ }
+
+ return {
+ contact: `${ac}${pfx}${linenum}`,
+ extension: ext,
+ processed: true,
+ international: !!intl,
+ countryCode: intl && intl !== '1' ? intl : undefined,
+ };
};
diff --git a/src/applications/gi/components/profile/InstitutionProfile.jsx b/src/applications/gi/components/profile/InstitutionProfile.jsx
index 25f1488e5a2d..c4819cbddfc0 100644
--- a/src/applications/gi/components/profile/InstitutionProfile.jsx
+++ b/src/applications/gi/components/profile/InstitutionProfile.jsx
@@ -209,12 +209,12 @@ export default function InstitutionProfile({
id="yellow-ribbon-program-information"
>
- The Yellow Ribbon program pays towards net tuition and fee costs
- not covered by the Post-9/11 GI Bill at participating institutions
- of higher learning (IHL). Schools that choose to participate in
- the Yellow Ribbon program will contribute up to a certain dollar
- amount toward the extra tuition. VA will match the participating
- school’s contribution
+ The Yellow Ribbon program may pay towards net tuition and fee
+ costs not covered by the Post-9/11 GI Bill at participating
+ institutions of higher learning (IHL). Schools that choose to
+ participate in the Yellow Ribbon program will contribute up to a
+ certain dollar amount toward the extra tuition. VA will match the
+ participating school’s contribution
{type === 'FOREIGN' && `${` `}in United States Dollars (USD)`}, up
to the total cost of the tuition and fees. To confirm the number
of students eligible for funding, contact the individual school.
@@ -228,7 +228,7 @@ export default function InstitutionProfile({
- What to know about the content displayed below
+ What to know about the content displayed
diff --git a/src/applications/ivc-champva/10-10D/config/form.js b/src/applications/ivc-champva/10-10D/config/form.js
index 1128df06b39d..d73f7e89d317 100644
--- a/src/applications/ivc-champva/10-10D/config/form.js
+++ b/src/applications/ivc-champva/10-10D/config/form.js
@@ -422,12 +422,13 @@ const formConfig = {
sponsorInfoTitle: titleUI('Sponsor status details'),
sponsorDOD: dateOfDeathUI('When did the sponsor die?'),
sponsorDeathConditions: yesNoUI({
- title: 'Did sponsor die during active military service?',
+ title: 'Did the sponsor die during active military service?',
hint: ADDITIONAL_FILES_HINT,
labels: {
- yes: 'Yes, sponsor passed away during active military service',
+ yes:
+ 'Yes, the sponsor passed away during active military service',
no:
- 'No, sponsor did not pass away during active military service',
+ 'No, the sponsor did not pass away during active military service',
},
}),
},
@@ -598,7 +599,7 @@ const formConfig = {
undefined,
false,
)}. This includes social security number, mailing address,
- contact information, relationship to sponsor, and health
+ contact information, relationship to the sponsor, and health
insurance information.`,
),
},
@@ -770,7 +771,8 @@ const formConfig = {
path: 'applicant-relationship/:index',
arrayPath: 'applicants',
showPagePerItem: true,
- title: item => `${applicantWording(item)} relationship to sponsor`,
+ title: item =>
+ `${applicantWording(item)} relationship to the sponsor`,
CustomPage: ApplicantRelationshipPage,
CustomPageReview: ApplicantRelationshipReviewPage,
schema: applicantListSchema([], {
diff --git a/src/applications/ivc-champva/10-10D/pages/ApplicantSponsorMarriageDetailsPage.jsx b/src/applications/ivc-champva/10-10D/pages/ApplicantSponsorMarriageDetailsPage.jsx
index 072c887b18d2..881db19e7a14 100644
--- a/src/applications/ivc-champva/10-10D/pages/ApplicantSponsorMarriageDetailsPage.jsx
+++ b/src/applications/ivc-champva/10-10D/pages/ApplicantSponsorMarriageDetailsPage.jsx
@@ -121,7 +121,7 @@ function marriageTitle(text, subtitle) {
const dateOfMarriageToSponsor = {
...currentOrPastDateUI({
- title: 'Date of marriage to sponsor',
+ title: 'Date of marriage to the sponsor',
errorMessages: {
pattern: 'Please provide a valid date',
required: 'Please provide the date of marriage',
@@ -144,7 +144,7 @@ export const marriageDatesSchema = {
'ui:options': { viewField: ApplicantField },
items: {
'ui:options': marriageTitle(
- ' date of marriage to sponsor',
+ ' date of marriage to the sponsor',
'If you don’t know the exact date, enter your best guess',
),
dateOfMarriageToSponsor,
diff --git a/src/applications/ivc-champva/10-10D/sass/10-10D.scss b/src/applications/ivc-champva/10-10D/sass/10-10D.scss
index 30894f178e2c..a835fe027d94 100644
--- a/src/applications/ivc-champva/10-10D/sass/10-10D.scss
+++ b/src/applications/ivc-champva/10-10D/sass/10-10D.scss
@@ -16,3 +16,7 @@ va-accordion-item[data-chapter="uploadFiles"] {
display: none;
visibility: hidden;
}
+
+.va-growable {
+ padding-left: 10px;
+}
\ No newline at end of file
diff --git a/src/applications/ivc-champva/10-10D/tests/unit/config/form.unit.spec.jsx b/src/applications/ivc-champva/10-10D/tests/unit/config/form.unit.spec.jsx
index eafd8f6e534e..8983f4c3bb24 100644
--- a/src/applications/ivc-champva/10-10D/tests/unit/config/form.unit.spec.jsx
+++ b/src/applications/ivc-champva/10-10D/tests/unit/config/form.unit.spec.jsx
@@ -178,7 +178,7 @@ testNumberOfWebComponentFields(
formConfig.chapters.applicantInformation.pages.page18c.schema,
formConfig.chapters.applicantInformation.pages.page18c.uiSchema,
0,
- 'Applicant - relationship to sponsor',
+ 'Applicant - relationship to the sponsor',
{ ...mockData.data },
);
diff --git a/src/applications/letters/components/DownloadLetterLink.jsx b/src/applications/letters/components/DownloadLetterLink.jsx
index d68acc723799..89262bf4d560 100644
--- a/src/applications/letters/components/DownloadLetterLink.jsx
+++ b/src/applications/letters/components/DownloadLetterLink.jsx
@@ -22,7 +22,7 @@ export class DownloadLetterLink extends React.Component {
});
this.props.getLetterPdf(
this.props.letterType,
- this.props.letterName,
+ this.props.letterTitle,
this.props.letterOptions,
this.props.LH_MIGRATION__options,
);
@@ -38,7 +38,7 @@ export class DownloadLetterLink extends React.Component {
buttonDisabled = true;
break;
case DOWNLOAD_STATUSES.success:
- buttonText = `${this.props.letterName} (PDF)`;
+ buttonText = `${this.props.letterTitle} (PDF)`;
buttonDisabled = undefined;
message = (
@@ -64,7 +64,7 @@ export class DownloadLetterLink extends React.Component {
);
break;
default:
- buttonText = `${this.props.letterName} (PDF)`;
+ buttonText = `${this.props.letterTitle} (PDF)`;
buttonDisabled = undefined;
}
@@ -101,7 +101,7 @@ export class DownloadLetterLink extends React.Component {
function mapStateToProps(state, ownProps) {
return {
letterType: ownProps.letterType,
- letterName: ownProps.letterName,
+ letterTitle: ownProps.letterTitle,
downloadStatus: ownProps.downloadStatus,
letterOptions: state.letters.requestOptions,
shouldUseLighthouse: state.shouldUseLighthouse,
@@ -109,7 +109,7 @@ function mapStateToProps(state, ownProps) {
}
DownloadLetterLink.propTypes = {
- letterName: PropTypes.string.isRequired,
+ letterTitle: PropTypes.string.isRequired,
letterType: PropTypes.string.isRequired,
downloadStatus: PropTypes.string,
};
diff --git a/src/applications/letters/containers/LetterList.jsx b/src/applications/letters/containers/LetterList.jsx
index 261a0df3c6ae..24767fa70091 100644
--- a/src/applications/letters/containers/LetterList.jsx
+++ b/src/applications/letters/containers/LetterList.jsx
@@ -59,7 +59,7 @@ export class LetterList extends React.Component {
conditionalDownloadButton = (
', () => {
expect(getLetterPdf.args[0]).to.eql([
defaultProps.letterType,
- defaultProps.letterName,
+ defaultProps.letterTitle,
undefined,
undefined,
]);
diff --git a/src/applications/mhv-medical-records/actions/vitals.js b/src/applications/mhv-medical-records/actions/vitals.js
index c4b1b990e68a..c1e7304f1759 100644
--- a/src/applications/mhv-medical-records/actions/vitals.js
+++ b/src/applications/mhv-medical-records/actions/vitals.js
@@ -32,6 +32,12 @@ export const getVitals = (
}
};
+/**
+ * Updates the list of vitals with the selected vital type, **will** make an API call to populate the data
+ *
+ * @param {string} vitalType a valid vital type
+ * @param {array} vitalList the list of vitals to check if it's empty
+ */
export const getVitalDetails = (vitalType, vitalList) => async dispatch => {
try {
if (!isArrayAndHasItems(vitalList)) {
@@ -44,6 +50,15 @@ export const getVitalDetails = (vitalType, vitalList) => async dispatch => {
}
};
+/**
+ * Updates the list of vitals with the selected vital type, **will not** make an API call to populate the data
+ *
+ * @param {string} vitalType a valid vital type
+ */
+export const setVitalsList = vitalType => async dispatch => {
+ dispatch({ type: Actions.Vitals.GET, vitalType });
+};
+
export const clearVitalDetails = () => async dispatch => {
dispatch({ type: Actions.Vitals.CLEAR_DETAIL });
};
diff --git a/src/applications/mhv-medical-records/components/MrBreadcrumbs.jsx b/src/applications/mhv-medical-records/components/MrBreadcrumbs.jsx
index d5debacfe2e8..358636146e21 100644
--- a/src/applications/mhv-medical-records/components/MrBreadcrumbs.jsx
+++ b/src/applications/mhv-medical-records/components/MrBreadcrumbs.jsx
@@ -5,12 +5,13 @@ import { Link, useHistory, useLocation, useParams } from 'react-router-dom';
import { Breadcrumbs, Paths } from '../util/constants';
import { setBreadcrumbs } from '../actions/breadcrumbs';
import { clearPageNumber, setPageNumber } from '../actions/pageTracker';
-import { handleDataDogAction } from '../util/helpers';
+import { handleDataDogAction, removeTrailingSlash } from '../util/helpers';
const MrBreadcrumbs = () => {
const dispatch = useDispatch();
const location = useLocation();
const history = useHistory();
+
const crumbsList = useSelector(state => state.mr.breadcrumbs.crumbsList);
const pageNumber = useSelector(state => state.mr.pageTracker.pageNumber);
const phase0p5Flag = useSelector(
@@ -27,10 +28,12 @@ const MrBreadcrumbs = () => {
);
const textContent = document.querySelector('h1')?.textContent;
- const searchIndex = new URLSearchParams(window.location.search);
+ const searchIndex = new URLSearchParams(location.search);
const page = searchIndex.get('page');
const { labId, vaccineId, summaryId, allergyId, conditionId } = useParams();
+ const urlVitalsDate = searchIndex.get('timeFrame');
+
useEffect(
() => {
if (page) dispatch(setPageNumber(+page));
@@ -56,12 +59,19 @@ const MrBreadcrumbs = () => {
if (pageNumber) {
backToPageNumCrumb = {
...Breadcrumbs[feature],
- href: `${Breadcrumbs[feature].href.slice(
- 0,
- -1,
+ href: `${removeTrailingSlash(
+ Breadcrumbs[feature].href,
)}?page=${pageNumber}`,
};
dispatch(setBreadcrumbs([backToPageNumCrumb, detailCrumb]));
+ } else if (urlVitalsDate) {
+ const backToVitalsDateCrumb = {
+ ...Breadcrumbs[feature],
+ href: `${removeTrailingSlash(
+ Breadcrumbs[feature].href,
+ )}?timeFrame=${urlVitalsDate}`,
+ };
+ dispatch(setBreadcrumbs([backToVitalsDateCrumb, detailCrumb]));
} else {
dispatch(setBreadcrumbs([Breadcrumbs[feature], detailCrumb]));
}
@@ -69,7 +79,14 @@ const MrBreadcrumbs = () => {
dispatch(setBreadcrumbs([Breadcrumbs[feature]]));
}
},
- [dispatch, locationBasePath, locationChildPath, textContent, pageNumber],
+ [
+ dispatch,
+ locationBasePath,
+ locationChildPath,
+ textContent,
+ pageNumber,
+ urlVitalsDate,
+ ],
);
const handleRouteChange = ({ detail }) => {
diff --git a/src/applications/mhv-medical-records/components/RecordList/VitalListItem.jsx b/src/applications/mhv-medical-records/components/RecordList/VitalListItem.jsx
index eb7d4cd8f144..be3566b9abed 100644
--- a/src/applications/mhv-medical-records/components/RecordList/VitalListItem.jsx
+++ b/src/applications/mhv-medical-records/components/RecordList/VitalListItem.jsx
@@ -11,7 +11,7 @@ import {
const VitalListItem = props => {
const { record, options = {} } = props;
- const { isAccelerating } = options;
+ const { isAccelerating, timeFrame } = options;
const displayName = vitalTypeDisplayNames[record.type];
const ddLabelName = useMemo(
@@ -61,6 +61,10 @@ const VitalListItem = props => {
[updatedRecordType, isAccelerating],
);
+ const url = `/vitals/${kebabCase(updatedRecordType)}-history${
+ isAccelerating ? `?timeFrame=${timeFrame}` : ''
+ }`;
+
return (
{
- >
- );
-}
diff --git a/src/applications/representative-appoint/config/form.js b/src/applications/representative-appoint/config/form.js
index 0a2fdc42d0a3..0add5f0207a0 100644
--- a/src/applications/representative-appoint/config/form.js
+++ b/src/applications/representative-appoint/config/form.js
@@ -2,6 +2,7 @@ import commonDefinitions from 'vets-json-schema/dist/definitions.json';
// import environment from '@department-of-veterans-affairs/platform-utilities/environment';
// import profileContactInfo from 'platform/forms-system/src/js/definitions/profileContactInfo';
import FormFooter from 'platform/forms/components/FormFooter';
+import GetFormHelp from '../components/GetFormHelp';
import configService from '../utilities/configService';
import manifest from '../manifest.json';
import IntroductionPage from '../containers/IntroductionPage';
@@ -65,6 +66,7 @@ const formConfig = {
introduction: IntroductionPage,
confirmation: ConfirmationPage,
footerContent: FormFooter,
+ getHelp: GetFormHelp,
formId: '21-22',
preSubmitInfo: {
CustomComponent: PreSubmitInfo,
diff --git a/src/applications/representative-appoint/containers/ConfirmationPage.jsx b/src/applications/representative-appoint/containers/ConfirmationPage.jsx
index 81ad42bb31c9..5e7a11ddb577 100644
--- a/src/applications/representative-appoint/containers/ConfirmationPage.jsx
+++ b/src/applications/representative-appoint/containers/ConfirmationPage.jsx
@@ -4,10 +4,11 @@ import PropTypes from 'prop-types';
import { VaCheckbox } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import scrollTo from 'platform/utilities/ui/scrollTo';
-import NeedHelp from '../components/NeedHelp';
import sendNextStepsEmail from '../api/sendNextStepsEmail';
import { getFormNumber, getFormName } from '../utilities/helpers';
+import GetFormHelp from '../components/GetFormHelp';
+
export default function ConfirmationPage({ router }) {
const [signedForm, setSignedForm] = useState(false);
const [signedFormError, setSignedFormError] = useState(false);
@@ -79,7 +80,11 @@ export default function ConfirmationPage({ router }) {
onVaChange={handlers.onChangeSignedFormCheckbox}
/>
-
+
+
+
Need help?
+
+
>
);
}
diff --git a/src/applications/representative-appoint/containers/IntroductionPage.jsx b/src/applications/representative-appoint/containers/IntroductionPage.jsx
index 170dcb62c768..3c6a74ba4140 100644
--- a/src/applications/representative-appoint/containers/IntroductionPage.jsx
+++ b/src/applications/representative-appoint/containers/IntroductionPage.jsx
@@ -6,7 +6,6 @@ import SaveInProgressIntro from 'platform/forms/save-in-progress/SaveInProgressI
import repStatusLoader from 'applications/static-pages/representative-status';
import { useStore, connect } from 'react-redux';
import { isLoggedIn } from 'platform/user/selectors';
-import GetFormHelp from '../components/GetFormHelp';
const IntroductionPage = props => {
const { route, loggedIn } = props;
@@ -144,7 +143,6 @@ const IntroductionPage = props => {
res-burden="5"
/>
-
);
};
diff --git a/src/applications/representative-appoint/containers/NextStepsPage.jsx b/src/applications/representative-appoint/containers/NextStepsPage.jsx
index 3892994adc73..a4d08aa056c4 100644
--- a/src/applications/representative-appoint/containers/NextStepsPage.jsx
+++ b/src/applications/representative-appoint/containers/NextStepsPage.jsx
@@ -4,7 +4,8 @@ import FormTitle from 'platform/forms-system/src/js/components/FormTitle';
import scrollTo from 'platform/utilities/ui/scrollTo';
import ContactCard from '../components/ContactCard';
import AddressBlock from '../components/AddressBlock';
-import NeedHelp from '../components/NeedHelp';
+import GetFormHelp from '../components/GetFormHelp';
+
import {
addressExists,
getFormSubtitle,
@@ -70,7 +71,10 @@ export default function NextStepsPage() {
Go back to VA.gov
-
+
+
Need help?
+
+
);
}
diff --git a/src/applications/simple-forms-form-engine/shared/actions/form-load/index.js b/src/applications/simple-forms-form-engine/shared/actions/form-load/index.js
index 3bcac8080779..0125909e225d 100644
--- a/src/applications/simple-forms-form-engine/shared/actions/form-load/index.js
+++ b/src/applications/simple-forms-form-engine/shared/actions/form-load/index.js
@@ -6,7 +6,7 @@ export const INTEGRATION_DEPLOYMENT =
'https://pr18811-ps4nwwul37jtyembecv4bg0gafmyl3oj.ci.cms.va.gov';
import { fetchDrupalStaticDataFile } from 'platform/site-wide/drupal-static-data/connect/fetch';
-import mockForms from '../../_config/formConfig';
+import mockForms from '../../config/formConfig';
import { createFormConfig } from '../../utils/formConfig';
export const formLoadingInitiated = formId => {
diff --git a/src/applications/simple-forms-form-engine/shared/_config/formConfig.js b/src/applications/simple-forms-form-engine/shared/config/formConfig.js
similarity index 100%
rename from src/applications/simple-forms-form-engine/shared/_config/formConfig.js
rename to src/applications/simple-forms-form-engine/shared/config/formConfig.js
diff --git a/src/applications/simple-forms-form-engine/shared/config/submitTransformer.js b/src/applications/simple-forms-form-engine/shared/config/submitTransformer.js
new file mode 100644
index 000000000000..0ffc94b381a9
--- /dev/null
+++ b/src/applications/simple-forms-form-engine/shared/config/submitTransformer.js
@@ -0,0 +1,28 @@
+import { transformForSubmit as platformTransformForSubmit } from 'platform/forms-system/exportsFile';
+
+/**
+ * @param formConfig {FormConfig}
+ * @param form {Object}
+ * @returns {string} The transformed form data as a JSON string
+ */
+const transformForSubmit = (formConfig, form) => {
+ // We need the form number to send it to the right model
+ const formData = {
+ ...form.data,
+ formNumber: formConfig.formId,
+ };
+
+ /** @type {ReplacerOptions} */
+ const options = { replaceEscapedCharacters: true };
+
+ return platformTransformForSubmit(
+ formConfig,
+ {
+ ...form,
+ data: formData,
+ },
+ options,
+ );
+};
+
+export default transformForSubmit;
diff --git a/src/applications/simple-forms-form-engine/shared/tests/unit/actions/form-load.unit.spec.js b/src/applications/simple-forms-form-engine/shared/tests/unit/actions/form-load.unit.spec.js
index 1e7675924976..b44e07c20c9e 100644
--- a/src/applications/simple-forms-form-engine/shared/tests/unit/actions/form-load.unit.spec.js
+++ b/src/applications/simple-forms-form-engine/shared/tests/unit/actions/form-load.unit.spec.js
@@ -2,7 +2,7 @@ import { expect } from 'chai';
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import { DATA_FILES_PATH } from 'platform/site-wide/drupal-static-data/constants';
-import { normalizedForm } from '../../../_config/formConfig';
+import { normalizedForm } from '../../../config/formConfig';
import {
DIGITAL_FORMS_FILENAME,
FORM_LOADING_SUCCEEDED,
diff --git a/src/applications/simple-forms-form-engine/shared/tests/unit/config/submitTransformer.unit.spec.js b/src/applications/simple-forms-form-engine/shared/tests/unit/config/submitTransformer.unit.spec.js
new file mode 100644
index 000000000000..e5f98bf4ac41
--- /dev/null
+++ b/src/applications/simple-forms-form-engine/shared/tests/unit/config/submitTransformer.unit.spec.js
@@ -0,0 +1,34 @@
+import { expect } from 'chai';
+import * as helpers from 'platform/forms-system/src/js/helpers';
+import sinon from 'sinon';
+import transformForSubmit from '../../../config/submitTransformer';
+
+describe('transformForSubmit', () => {
+ let spy;
+ let transformedString;
+
+ const form = { data: {} };
+ const formConfig = { formId: '1234' };
+
+ beforeEach(() => {
+ spy = sinon.spy(helpers, 'transformForSubmit');
+
+ transformedString = transformForSubmit(formConfig, form);
+ });
+
+ afterEach(() => {
+ spy.restore();
+ });
+
+ it('calls the platform transformForSubmit', () => {
+ expect(spy.calledWith(formConfig)).to.eq(true);
+
+ const options = spy.getCall(0).args[2];
+
+ expect(options.replaceEscapedCharacters).to.eq(true);
+ });
+
+ it('includes the form number', () => {
+ expect(JSON.parse(transformedString).formNumber).to.eq(formConfig.formId);
+ });
+});
diff --git a/src/applications/simple-forms-form-engine/shared/tests/unit/utils/digitalFormPatterns.unit.spec.js b/src/applications/simple-forms-form-engine/shared/tests/unit/utils/digitalFormPatterns.unit.spec.js
index 484a308cc6db..33a91503fc3e 100644
--- a/src/applications/simple-forms-form-engine/shared/tests/unit/utils/digitalFormPatterns.unit.spec.js
+++ b/src/applications/simple-forms-form-engine/shared/tests/unit/utils/digitalFormPatterns.unit.spec.js
@@ -3,7 +3,7 @@ import sinon from 'sinon';
import * as webComponentPatterns from 'platform/forms-system/src/js/web-component-patterns';
import * as addressPatterns from 'platform/forms-system/src/js/web-component-patterns/addressPattern';
import * as digitalFormPatterns from '../../../utils/digitalFormPatterns';
-import { normalizedForm } from '../../../_config/formConfig';
+import { normalizedForm } from '../../../config/formConfig';
const {
addressPages,
diff --git a/src/applications/simple-forms-form-engine/shared/tests/unit/utils/formConfig.unit.spec.js b/src/applications/simple-forms-form-engine/shared/tests/unit/utils/formConfig.unit.spec.js
index dea57b2f1497..4f80ab01ae50 100644
--- a/src/applications/simple-forms-form-engine/shared/tests/unit/utils/formConfig.unit.spec.js
+++ b/src/applications/simple-forms-form-engine/shared/tests/unit/utils/formConfig.unit.spec.js
@@ -7,7 +7,8 @@ import sinon from 'sinon';
import { render } from '@testing-library/react';
import * as digitalFormPatterns from '../../../utils/digitalFormPatterns';
import * as IntroductionPage from '../../../containers/IntroductionPage';
-import { normalizedForm } from '../../../_config/formConfig';
+import * as submitTransform from '../../../config/submitTransformer';
+import { normalizedForm } from '../../../config/formConfig';
import {
createFormConfig,
formatPages,
@@ -24,6 +25,7 @@ const [
describe('createFormConfig', () => {
let formConfig;
let stub;
+ let transformSpy;
beforeEach(() => {
const FakeComponent = ({ ombInfo }) => (
@@ -42,6 +44,7 @@ describe('createFormConfig', () => {
}),
};
stub = sinon.stub(IntroductionPage, 'default').callsFake(FakeComponent);
+ transformSpy = sinon.spy(submitTransform, 'default');
formConfig = createFormConfig(normalizedForm, {
rootUrl: '/root-url',
@@ -51,6 +54,7 @@ describe('createFormConfig', () => {
afterEach(() => {
stub.restore();
+ transformSpy.restore();
});
it('returns a properly formatted Form Config object', () => {
@@ -97,6 +101,18 @@ describe('createFormConfig', () => {
expect(statementOfTruth.body).to.eq(statementOfTruthBody);
expect(statementOfTruth.fullNamePath).to.eq('fullName');
});
+
+ it('includes transformForSubmit', () => {
+ const form = { data: {} };
+
+ formConfig.transformForSubmit(formConfig, form);
+
+ expect(transformSpy.calledWith(formConfig, form)).to.eq(true);
+ });
+
+ it('does not include a custom submit', () => {
+ expect(formConfig.submit).to.eq(undefined);
+ });
});
describe('formatPages', () => {
diff --git a/src/applications/simple-forms-form-engine/shared/utils/formConfig.js b/src/applications/simple-forms-form-engine/shared/utils/formConfig.js
index 65a2e16ac907..4257df6da224 100644
--- a/src/applications/simple-forms-form-engine/shared/utils/formConfig.js
+++ b/src/applications/simple-forms-form-engine/shared/utils/formConfig.js
@@ -7,6 +7,7 @@ import {
personalInfoPages,
phoneAndEmailPages,
} from './digitalFormPatterns';
+import transformForSubmit from '../config/submitTransformer';
const getChapterKey = chapter =>
chapter.type === 'digital_form_your_personal_info'
@@ -64,14 +65,13 @@ export const createFormConfig = (form, options) => {
},
},
rootUrl,
- urlPrefix: '/',
- // eslint-disable-next-line no-console
- submit: () => console.log(`Submitted ${subTitle}`),
introduction: props => ,
confirmation: ConfirmationPage,
formId,
saveInProgress: {},
trackingPrefix,
+ transformForSubmit,
+ urlPrefix: '/',
version: 0,
prefillEnabled: true,
savedFormMessages: {
diff --git a/src/applications/simple-forms/20-10207/tests/unit/containers/ConfirmationPage.unit.spec.jsx b/src/applications/simple-forms/20-10207/tests/unit/containers/ConfirmationPage.unit.spec.jsx
index 9e1c9fe80700..a47dbef6b629 100644
--- a/src/applications/simple-forms/20-10207/tests/unit/containers/ConfirmationPage.unit.spec.jsx
+++ b/src/applications/simple-forms/20-10207/tests/unit/containers/ConfirmationPage.unit.spec.jsx
@@ -3,7 +3,6 @@ import React from 'react';
import { expect } from 'chai';
import { mount } from 'enzyme';
import { createStore } from 'redux';
-import configureMockStore from 'redux-mock-store';
import { Provider } from 'react-redux';
import { cleanup } from '@testing-library/react';
import { format } from 'date-fns';
@@ -12,32 +11,35 @@ import formConfig from '../../../config/form';
import ConfirmationPage from '../../../containers/ConfirmationPage';
import testData from '../../e2e/fixtures/data/backend-mapping-support/veteran-maximal-2.json';
-describe('ConfirmationPage', () => {
- let wrapper;
- let store;
- const mockStore = configureMockStore();
- const initialState = {
- form: {
- data: {
- ...createInitialState(formConfig),
- ...testData.data,
- },
- submission: {
- response: {
- confirmationNumber: '1234567890',
- },
- timestamp: '2022-01-01T00:00:00Z',
+const submitDate = new Date();
+const initialState = {
+ form: {
+ ...createInitialState(formConfig),
+ testData,
+ submission: {
+ response: {
+ confirmationNumber: '1234567890',
},
+ timestamp: submitDate,
},
- };
+ },
+};
+const mockStore = state => createStore(() => state);
+
+const mountPage = (state = initialState) => {
+ const store = mockStore(state);
+ return mount(
+
+
+ ,
+ );
+};
+
+describe('ConfirmationPage', () => {
+ let wrapper;
beforeEach(() => {
- store = mockStore(initialState);
- wrapper = mount(
-
-
- ,
- );
+ wrapper = mountPage();
});
afterEach(() => {
@@ -50,52 +52,20 @@ describe('ConfirmationPage', () => {
it('passes the correct props to ConfirmationPageView', () => {
const confirmationViewProps = wrapper.find('ConfirmationView').props();
- expect(confirmationViewProps.submitDate).to.equal('2022-01-01T00:00:00Z');
+ expect(confirmationViewProps.submitDate).to.equal(submitDate);
expect(confirmationViewProps.confirmationNumber).to.equal('1234567890');
});
it('should select form from state when state.form is defined', () => {
- const submitDate = new Date();
- const mockInitialState = {
- form: {
- submission: {
- timestamp: submitDate,
- response: { confirmationNumber: '1234' },
- },
- data: {
- ...createInitialState(formConfig),
- ...testData.data,
- },
- },
- };
- const mockDefinedState = createStore(() => mockInitialState);
-
- const definedWrapper = mount(
-
-
- ,
- );
-
- expect(definedWrapper.text()).to.include(
- format(submitDate, 'MMMM d, yyyy'),
- );
- expect(definedWrapper.text()).to.include('1234');
-
- definedWrapper.unmount();
+ expect(wrapper.text()).to.include(format(submitDate, 'MMMM d, yyyy'));
+ expect(wrapper.text()).to.include('1234');
});
it('should throw error when state.form is undefined', () => {
- const mockEmptyState = {};
- const mockEmptyStore = createStore(() => mockEmptyState);
-
let errorWrapper;
expect(() => {
- errorWrapper = mount(
-
-
- ,
- );
+ errorWrapper = mountPage({});
}).to.throw();
if (errorWrapper) {
diff --git a/src/applications/simple-forms/21-4142/containers/ConfirmationPage.jsx b/src/applications/simple-forms/21-4142/containers/ConfirmationPage.jsx
index 34f096bc1e99..1b9ae05017f5 100644
--- a/src/applications/simple-forms/21-4142/containers/ConfirmationPage.jsx
+++ b/src/applications/simple-forms/21-4142/containers/ConfirmationPage.jsx
@@ -2,15 +2,21 @@ import React from 'react';
import PropTypes from 'prop-types';
import { connect, useSelector } from 'react-redux';
-import { ConfirmationPageView } from '../../shared/components/ConfirmationPageView';
+import { ConfirmationView } from 'platform/forms-system/src/js/components/ConfirmationView';
-const content = {
- headlineText: 'Thank you for submitting your authorization request',
- nextStepsText:
- 'After we review your authorization, we’ll contact the private provider or hospital to get the requested records. If we can’t get the records within 15 days we’ll send you a follow-up letter by mail.',
-};
+const alertContent = confirmationNumber => (
+ <>
+
Thank you for submitting your authorization request
+
+ After we review your authorization, we’ll contact the private provider or
+ hospital to get the requested records. If we can’t get the records within
+ 15 days we’ll send you a follow-up letter by mail.
+
+
Your confirmation number is {confirmationNumber}.
+ >
+);
-export const ConfirmationPage = () => {
+export const ConfirmationPage = props => {
const form = useSelector(state => state.form || {});
const { submission, data } = form;
const preparerNameDefined =
@@ -23,12 +29,27 @@ export const ConfirmationPage = () => {
const confirmationNumber = submission.response?.confirmationNumber;
return (
-
+ submitterName={preparerName}
+ pdfUrl={submission.response?.pdfUrl}
+ devOnly={{
+ showButtons: true,
+ }}
+ >
+
+
+
+
+
+
+
+
+
);
};
@@ -42,10 +63,18 @@ ConfirmationPage.propTypes = {
}),
formId: PropTypes.string,
submission: PropTypes.shape({
+ response: PropTypes.shape({
+ attributes: PropTypes.shape({
+ confirmationNumber: PropTypes.string.isRequired,
+ }).isRequired,
+ }).isRequired,
timestamp: PropTypes.string,
}),
}),
name: PropTypes.string,
+ route: PropTypes.shape({
+ formConfig: PropTypes.object,
+ }),
};
function mapStateToProps(state) {
diff --git a/src/applications/simple-forms/21-4142/tests/containers/ConfirmationPage.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/containers/ConfirmationPage.unit.spec.jsx
deleted file mode 100644
index 6fddd6f83d2f..000000000000
--- a/src/applications/simple-forms/21-4142/tests/containers/ConfirmationPage.unit.spec.jsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import React from 'react';
-import { Provider } from 'react-redux';
-import { render } from '@testing-library/react';
-import configureStore from 'redux-mock-store';
-import thunk from 'redux-thunk';
-import { expect } from 'chai';
-import formConfig from '../../config/form';
-import ConfirmationPage from '../../containers/ConfirmationPage';
-
-const storeBase = {
- form: {
- formId: formConfig.formId,
- submission: {
- response: {
- confirmationNumber: '123456',
- },
- timestamp: Date.now(),
- },
- data: {
- veteran: {
- fullName: {
- first: 'Jack',
- middle: 'W',
- last: 'Witness',
- },
- },
- },
- },
-};
-
-describe('Confirmation page', () => {
- const middleware = [thunk];
- const mockStore = configureStore(middleware);
-
- it('it should show status success and the correct name of person', () => {
- const { container, getByText } = render(
-
-
- ,
- );
- expect(container.querySelector('va-alert')).to.have.attr(
- 'status',
- 'success',
- );
- getByText(/Jack W Witness/);
- });
-});
diff --git a/src/applications/simple-forms/21-4142/tests/components/RecordField.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/components/RecordField.unit.spec.jsx
similarity index 84%
rename from src/applications/simple-forms/21-4142/tests/components/RecordField.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/components/RecordField.unit.spec.jsx
index 7912e0316da6..135109a1c6b4 100644
--- a/src/applications/simple-forms/21-4142/tests/components/RecordField.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/components/RecordField.unit.spec.jsx
@@ -1,6 +1,6 @@
import React from 'react';
import { render } from '@testing-library/react';
-import RecordField from '../../components/RecordField';
+import RecordField from '../../../components/RecordField';
describe('RecordField', () => {
it('should render', () => {
diff --git a/src/applications/simple-forms/21-4142/tests/unit/containers/ConfirmationPage.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/containers/ConfirmationPage.unit.spec.jsx
new file mode 100644
index 000000000000..f216902bf11e
--- /dev/null
+++ b/src/applications/simple-forms/21-4142/tests/unit/containers/ConfirmationPage.unit.spec.jsx
@@ -0,0 +1,74 @@
+import React from 'react';
+import { expect } from 'chai';
+import { mount } from 'enzyme';
+import { createStore } from 'redux';
+import { Provider } from 'react-redux';
+import { format } from 'date-fns';
+import { cleanup } from '@testing-library/react';
+import { createInitialState } from '@department-of-veterans-affairs/platform-forms-system/state/helpers';
+import ConfirmationPage from '../../../containers/ConfirmationPage';
+import formConfig from '../../../config/form';
+import testData from '../../e2e/fixtures/data/maximal-test.json';
+
+const submitDate = new Date();
+const initialState = {
+ form: {
+ ...createInitialState(formConfig),
+ testData,
+ submission: {
+ response: {
+ confirmationNumber: '1234567890',
+ },
+ timestamp: submitDate,
+ },
+ },
+};
+const mockStore = state => createStore(() => state);
+
+const mountPage = state => {
+ const store = mockStore(state);
+ return mount(
+
+
+ ,
+ );
+};
+
+describe('ConfirmationPage', () => {
+ let wrapper = null;
+
+ beforeEach(() => {
+ wrapper = mountPage(initialState);
+ });
+
+ afterEach(() => {
+ if (wrapper) {
+ wrapper.unmount();
+ }
+ cleanup();
+ });
+
+ it('passes the correct props to ConfirmationPageView', () => {
+ const confirmationViewProps = wrapper.find('ConfirmationView').props();
+
+ expect(confirmationViewProps.submitDate).to.equal(submitDate);
+ expect(confirmationViewProps.confirmationNumber).to.equal('1234567890');
+ });
+
+ it('should select form from state when state.form is defined', () => {
+ expect(wrapper.text()).to.include(format(submitDate, 'MMMM d, yyyy'));
+ expect(wrapper.text()).to.include('1234');
+ });
+
+ it('should throw error when state.form is undefined', () => {
+ let errorWrapper;
+
+ expect(() => {
+ errorWrapper = mountPage({});
+ }).to.throw();
+
+ if (errorWrapper) {
+ errorWrapper.unmount();
+ }
+ });
+});
diff --git a/src/applications/simple-forms/21-4142/tests/containers/IntroductionPage.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/containers/IntroductionPage.unit.spec.jsx
similarity index 91%
rename from src/applications/simple-forms/21-4142/tests/containers/IntroductionPage.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/containers/IntroductionPage.unit.spec.jsx
index 96236de1f574..7dd0732dc9b9 100644
--- a/src/applications/simple-forms/21-4142/tests/containers/IntroductionPage.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/containers/IntroductionPage.unit.spec.jsx
@@ -2,8 +2,8 @@ import React from 'react';
import { Provider } from 'react-redux';
import { render } from '@testing-library/react';
import { expect } from 'chai';
-import formConfig from '../../config/form';
-import IntroductionPage from '../../containers/IntroductionPage';
+import formConfig from '../../../config/form';
+import IntroductionPage from '../../../containers/IntroductionPage';
const props = {
route: {
diff --git a/src/applications/simple-forms/21-4142/tests/pages/authorization.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/authorization.unit.spec.jsx
similarity index 81%
rename from src/applications/simple-forms/21-4142/tests/pages/authorization.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/authorization.unit.spec.jsx
index 3bb05f2ff143..1f0d791757b7 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/authorization.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/authorization.unit.spec.jsx
@@ -1,8 +1,8 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
-} from '../../../shared/tests/pages/pageTests.spec';
-import formConfig from '../../config/form';
+} from '../../../../shared/tests/pages/pageTests.spec';
+import formConfig from '../../../config/form';
const {
schema,
diff --git a/src/applications/simple-forms/21-4142/tests/pages/contactInformation1.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/contactInformation1.unit.spec.jsx
similarity index 82%
rename from src/applications/simple-forms/21-4142/tests/pages/contactInformation1.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/contactInformation1.unit.spec.jsx
index cea3816c717d..dc779164f0b2 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/contactInformation1.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/contactInformation1.unit.spec.jsx
@@ -1,8 +1,8 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
-} from '../../../shared/tests/pages/pageTests.spec';
-import formConfig from '../../config/form';
+} from '../../../../shared/tests/pages/pageTests.spec';
+import formConfig from '../../../config/form';
const {
schema,
diff --git a/src/applications/simple-forms/21-4142/tests/pages/contactInformation2.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/contactInformation2.unit.spec.jsx
similarity index 89%
rename from src/applications/simple-forms/21-4142/tests/pages/contactInformation2.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/contactInformation2.unit.spec.jsx
index a936400e9885..63b9f3708429 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/contactInformation2.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/contactInformation2.unit.spec.jsx
@@ -3,8 +3,8 @@ import {
testNumberOfErrorsOnSubmitForWebComponents,
testNumberOfFields,
testNumberOfWebComponentFields,
-} from '../../../shared/tests/pages/pageTests.spec';
-import formConfig from '../../config/form';
+} from '../../../../shared/tests/pages/pageTests.spec';
+import formConfig from '../../../config/form';
const {
schema,
diff --git a/src/applications/simple-forms/21-4142/tests/pages/limitations.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/limitations.unit.spec.jsx
similarity index 81%
rename from src/applications/simple-forms/21-4142/tests/pages/limitations.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/limitations.unit.spec.jsx
index a89a488d5196..d6eb0030747e 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/limitations.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/limitations.unit.spec.jsx
@@ -1,8 +1,8 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
-} from '../../../shared/tests/pages/pageTests.spec';
-import formConfig from '../../config/form';
+} from '../../../../shared/tests/pages/pageTests.spec';
+import formConfig from '../../../config/form';
const { schema, uiSchema } = formConfig.chapters.limitations.pages.limitations;
diff --git a/src/applications/simple-forms/21-4142/tests/pages/patientIdentification1.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/patientIdentification1.unit.spec.jsx
similarity index 82%
rename from src/applications/simple-forms/21-4142/tests/pages/patientIdentification1.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/patientIdentification1.unit.spec.jsx
index c6b480a31100..7446a69a5f4e 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/patientIdentification1.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/patientIdentification1.unit.spec.jsx
@@ -1,8 +1,8 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
-} from '../../../shared/tests/pages/pageTests.spec';
-import formConfig from '../../config/form';
+} from '../../../../shared/tests/pages/pageTests.spec';
+import formConfig from '../../../config/form';
const {
schema,
diff --git a/src/applications/simple-forms/21-4142/tests/pages/patientIdentification2.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/patientIdentification2.unit.spec.jsx
similarity index 82%
rename from src/applications/simple-forms/21-4142/tests/pages/patientIdentification2.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/patientIdentification2.unit.spec.jsx
index 9137f2a9b43e..60a9e457987c 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/patientIdentification2.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/patientIdentification2.unit.spec.jsx
@@ -1,8 +1,8 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
-} from '../../../shared/tests/pages/pageTests.spec';
-import formConfig from '../../config/form';
+} from '../../../../shared/tests/pages/pageTests.spec';
+import formConfig from '../../../config/form';
const {
schema,
diff --git a/src/applications/simple-forms/21-4142/tests/pages/personalInformation1.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/personalInformation1.unit.spec.jsx
similarity index 82%
rename from src/applications/simple-forms/21-4142/tests/pages/personalInformation1.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/personalInformation1.unit.spec.jsx
index 5107f797a1f3..4b65607939e2 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/personalInformation1.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/personalInformation1.unit.spec.jsx
@@ -1,8 +1,8 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
-} from '../../../shared/tests/pages/pageTests.spec';
-import formConfig from '../../config/form';
+} from '../../../../shared/tests/pages/pageTests.spec';
+import formConfig from '../../../config/form';
const {
schema,
diff --git a/src/applications/simple-forms/21-4142/tests/pages/personalInformation2.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/personalInformation2.unit.spec.jsx
similarity index 82%
rename from src/applications/simple-forms/21-4142/tests/pages/personalInformation2.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/personalInformation2.unit.spec.jsx
index 7a8151458fc6..a8506ca23d73 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/personalInformation2.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/personalInformation2.unit.spec.jsx
@@ -1,8 +1,8 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
-} from '../../../shared/tests/pages/pageTests.spec';
-import formConfig from '../../config/form';
+} from '../../../../shared/tests/pages/pageTests.spec';
+import formConfig from '../../../config/form';
const {
schema,
diff --git a/src/applications/simple-forms/21-4142/tests/pages/preparerAddress1.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/preparerAddress1.unit.spec.jsx
similarity index 86%
rename from src/applications/simple-forms/21-4142/tests/pages/preparerAddress1.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/preparerAddress1.unit.spec.jsx
index 4ef071484d38..955bca7f68b3 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/preparerAddress1.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/preparerAddress1.unit.spec.jsx
@@ -1,13 +1,13 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
-} from '../../../shared/tests/pages/pageTests.spec';
+} from '../../../../shared/tests/pages/pageTests.spec';
import {
preparerIdentificationFields,
veteranFields,
veteranIsSelfText,
-} from '../../definitions/constants';
-import formConfig from '../../config/form';
+} from '../../../definitions/constants';
+import formConfig from '../../../config/form';
const {
schema,
diff --git a/src/applications/simple-forms/21-4142/tests/pages/preparerAddress2.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/preparerAddress2.unit.spec.jsx
similarity index 84%
rename from src/applications/simple-forms/21-4142/tests/pages/preparerAddress2.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/preparerAddress2.unit.spec.jsx
index f620be00b455..cd0f835062ee 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/preparerAddress2.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/preparerAddress2.unit.spec.jsx
@@ -1,12 +1,12 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
-} from '../../../shared/tests/pages/pageTests.spec';
+} from '../../../../shared/tests/pages/pageTests.spec';
import {
preparerIdentificationFields,
veteranIsSelfText,
-} from '../../definitions/constants';
-import formConfig from '../../config/form';
+} from '../../../definitions/constants';
+import formConfig from '../../../config/form';
const {
schema,
diff --git a/src/applications/simple-forms/21-4142/tests/pages/preparerIdentification.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/preparerIdentification.unit.spec.jsx
similarity index 82%
rename from src/applications/simple-forms/21-4142/tests/pages/preparerIdentification.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/preparerIdentification.unit.spec.jsx
index dd58f60defb1..53398694382d 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/preparerIdentification.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/preparerIdentification.unit.spec.jsx
@@ -1,8 +1,8 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
-} from '../../../shared/tests/pages/pageTests.spec';
-import formConfig from '../../config/form';
+} from '../../../../shared/tests/pages/pageTests.spec';
+import formConfig from '../../../config/form';
const {
schema,
diff --git a/src/applications/simple-forms/21-4142/tests/pages/preparerPersonalInformation.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/preparerPersonalInformation.unit.spec.jsx
similarity index 91%
rename from src/applications/simple-forms/21-4142/tests/pages/preparerPersonalInformation.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/preparerPersonalInformation.unit.spec.jsx
index 7f1298d8b95c..741c01bc62e0 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/preparerPersonalInformation.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/preparerPersonalInformation.unit.spec.jsx
@@ -1,12 +1,12 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
-} from '../../../shared/tests/pages/pageTests.spec';
+} from '../../../../shared/tests/pages/pageTests.spec';
import {
preparerIdentificationFields,
veteranDirectRelative,
-} from '../../definitions/constants';
-import formConfig from '../../config/form';
+} from '../../../definitions/constants';
+import formConfig from '../../../config/form';
const {
schema,
diff --git a/src/applications/simple-forms/21-4142/tests/pages/recordsRequested.unit.spec.jsx b/src/applications/simple-forms/21-4142/tests/unit/pages/recordsRequested.unit.spec.jsx
similarity index 79%
rename from src/applications/simple-forms/21-4142/tests/pages/recordsRequested.unit.spec.jsx
rename to src/applications/simple-forms/21-4142/tests/unit/pages/recordsRequested.unit.spec.jsx
index 0d7915762896..f9baf5eb2240 100644
--- a/src/applications/simple-forms/21-4142/tests/pages/recordsRequested.unit.spec.jsx
+++ b/src/applications/simple-forms/21-4142/tests/unit/pages/recordsRequested.unit.spec.jsx
@@ -1,9 +1,9 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
-} from '../../../shared/tests/pages/pageTests.spec';
-import { patientIdentificationFields } from '../../definitions/constants';
-import formConfig from '../../config/form';
+} from '../../../../shared/tests/pages/pageTests.spec';
+import { patientIdentificationFields } from '../../../definitions/constants';
+import formConfig from '../../../config/form';
const {
schema,
diff --git a/src/applications/simple-forms/form-upload/pages/upload.jsx b/src/applications/simple-forms/form-upload/pages/upload.jsx
index 4709a88559a1..d1a237e3b869 100644
--- a/src/applications/simple-forms/form-upload/pages/upload.jsx
+++ b/src/applications/simple-forms/form-upload/pages/upload.jsx
@@ -43,6 +43,8 @@ export const uploadPage = {
title,
formNumber,
required: () => true,
+ // Disallow uploads greater than 25 MB
+ maxFileSize: 25000000,
updateUiSchema: formData => {
return {
'ui:title': warningsPresent(formData)
diff --git a/src/applications/simple-forms/shared/config/submit-transformer.js b/src/applications/simple-forms/shared/config/submit-transformer.js
index eb5b58e487f5..759056b1ac25 100644
--- a/src/applications/simple-forms/shared/config/submit-transformer.js
+++ b/src/applications/simple-forms/shared/config/submit-transformer.js
@@ -1,17 +1,5 @@
import { transformForSubmit as formsSystemTransformForSubmit } from 'platform/forms-system/src/js/helpers';
-const escapedCharacterReplacer = (_key, value) => {
- if (typeof value === 'string') {
- return value
- .replaceAll('"', "'")
- .replace(/(?:\r\n|\n\n|\r|\n)/g, '; ')
- .replace(/(?:\t|\f|\b)/g, '')
- .replace(/\\(?!(f|n|r|t|[u,U][\d,a-fA-F]{4}))/gm, '/');
- }
-
- return value;
-};
-
/**
* Example:
* ```
@@ -27,11 +15,11 @@ const escapedCharacterReplacer = (_key, value) => {
*/
export default function transformForSubmit(formConfig, form, options) {
const transformedData = JSON.parse(
- formsSystemTransformForSubmit(formConfig, form, options),
+ formsSystemTransformForSubmit(formConfig, form, {
+ ...options,
+ replaceEscapedCharacters: true,
+ }),
);
- return JSON.stringify(
- { ...transformedData, formNumber: formConfig.formId },
- escapedCharacterReplacer,
- );
+ return JSON.stringify({ ...transformedData, formNumber: formConfig.formId });
}
diff --git a/src/applications/terms-of-use/helpers.js b/src/applications/terms-of-use/helpers.js
index 1576a62ffcf5..5c71f59e0abe 100644
--- a/src/applications/terms-of-use/helpers.js
+++ b/src/applications/terms-of-use/helpers.js
@@ -2,6 +2,7 @@ import {
environment,
eauthEnvironmentPrefixes,
cernerEnvPrefixes,
+ oracleHealthEnvPrefixes,
logoutUrlSiS,
} from '@department-of-veterans-affairs/platform-utilities/exports';
import {
@@ -18,7 +19,10 @@ export const parseRedirectUrl = url => {
const allowedDomains = [
`${new URL(environment.BASE_URL).hostname}`, // va.gov
`${eauthEnvironmentPrefixes[environment.BUILDTYPE]}eauth.va.gov`, // eauth
- `${cernerEnvPrefixes[environment.BUILDTYPE]}patientportal.myhealth.va.gov`, // cerner
+ `${cernerEnvPrefixes[environment.BUILDTYPE]}patientportal.myhealth.va.gov`, // oracle health staging
+ `${
+ oracleHealthEnvPrefixes[environment.BUILDTYPE]
+ }patientportal.myhealth.va.gov`, // oracle health sandbox
`${eauthEnvironmentPrefixes[environment.BUILDTYPE]}fed.eauth.va.gov`, // mobile
`vamobile://login-success`, // mobile again
];
diff --git a/src/applications/terms-of-use/tests/MyVAHealth.unit.spec.jsx b/src/applications/terms-of-use/tests/MyVAHealth.unit.spec.jsx
index e807be85d124..a47b431fcef8 100644
--- a/src/applications/terms-of-use/tests/MyVAHealth.unit.spec.jsx
+++ b/src/applications/terms-of-use/tests/MyVAHealth.unit.spec.jsx
@@ -13,6 +13,7 @@ const oldLocation = global.window.location;
describe('MyVAHealth', () => {
const ssoeTarget = `https://staging-patientportal.myhealth.va.gov`;
+ const altSsoeTarget = `https://sandbox-patientportal.myhealth.va.gov`;
const server = setupServer();
before(() => server.listen());
@@ -32,20 +33,23 @@ describe('MyVAHealth', () => {
expect(loadingIndicator).to.not.be.null;
});
- it('should redirect formatted redirect url when api returns 200', async () => {
- global.window.location = `https://dev.va.gov/terms-of-use/myvahealth/?ssoeTarget=${ssoeTarget}`;
+ [ssoeTarget, altSsoeTarget].forEach(targetUrl => {
+ it(`should redirect formatted redirect url (${targetUrl}) when api returns 200`, async () => {
+ global.window.location = `https://dev.va.gov/terms-of-use/myvahealth/?ssoeTarget=${targetUrl}`;
- server.use(
- rest.put(
- `https://dev-api.va.gov/v0/terms_of_use_agreements/update_provisioning`,
- (_, res, ctx) => res(ctx.status(200), ctx.json({ provisioned: true })),
- ),
- );
+ server.use(
+ rest.put(
+ `https://dev-api.va.gov/v0/terms_of_use_agreements/update_provisioning`,
+ (_, res, ctx) =>
+ res(ctx.status(200), ctx.json({ provisioned: true })),
+ ),
+ );
- render();
+ render();
- await waitFor(() => {
- expect(global.window.location).to.eql(ssoeTarget);
+ await waitFor(() => {
+ expect(global.window.location).to.eql(targetUrl);
+ });
});
});
diff --git a/src/applications/terms-of-use/tests/helpers.unit.spec.js b/src/applications/terms-of-use/tests/helpers.unit.spec.js
index 2f9072d7f335..1cf6561a5811 100644
--- a/src/applications/terms-of-use/tests/helpers.unit.spec.js
+++ b/src/applications/terms-of-use/tests/helpers.unit.spec.js
@@ -14,6 +14,7 @@ describe('parseRedirectUrl', () => {
[`https://int.eauth.va.gov/mhv-portal-web/eauth?deeplinking=home&postLogin=true`]: `https://int.eauth.va.gov/mhv-portal-web/eauth?deeplinking=home&postLogin=true`,
[`https://google.com?q=https://va.gov`]: `https://dev.va.gov`,
[`https%3A%2F%2Fint.eauth.va.gov%2Fisam%2Fsps%2Fauth%3FPartnerId%3Dhttps%3A%2F%2Fstaging-patientportal.myhealth.va.gov%2Fsession-api%2Fprotocol%2Fsaml2%2Fmetadata`]: `https://int.eauth.va.gov/isam/sps/auth?PartnerId=https://staging-patientportal.myhealth.va.gov/session-api/protocol/saml2/metadata`,
+ [`https%3A%2F%2Fint.eauth.va.gov%2Fisam%2Fsps%2Fauth%3FPartnerId%3Dhttps%3A%2F%2Fsandbox-patientportal.myhealth.va.gov%2Fsession-api%2Fprotocol%2Fsaml2%2Fmetadata`]: `https://int.eauth.va.gov/isam/sps/auth?PartnerId=https://sandbox-patientportal.myhealth.va.gov/session-api/protocol/saml2/metadata`,
[`vamobile%3A%2F%2Flogin-success%3Fcode%3D39d23d80-b10d-4e8a-a7e1-7a33fb87211a%26type%3Didme&terms_code=de85bea0-0b00-42a3-b491-d0a834542490`]: `vamobile://login-success?code=39d23d80-b10d-4e8a-a7e1-7a33fb87211a&type=idme&terms_code=de85bea0-0b00-42a3-b491-d0a834542490`,
};
diff --git a/src/applications/vaos/appointment-list/components/BackendAppointmentServiceAlert.unit.spec.js b/src/applications/vaos/appointment-list/components/BackendAppointmentServiceAlert.unit.spec.js
index 104852f1d6fe..3193791b39da 100644
--- a/src/applications/vaos/appointment-list/components/BackendAppointmentServiceAlert.unit.spec.js
+++ b/src/applications/vaos/appointment-list/components/BackendAppointmentServiceAlert.unit.spec.js
@@ -13,7 +13,7 @@ import {
getVAOSAppointmentMock,
getVAOSRequestMock,
} from '../../tests/mocks/mock';
-import RequestedAppointmentsListGroup from './RequestedAppointmentsListGroup';
+import RequestedAppointmentsPage from '../pages/RequestedAppointmentsPage/RequestedAppointmentsPage';
describe('VAOS Backend Service Alert', () => {
const initialState = {
@@ -359,18 +359,15 @@ describe('VAOS Backend Service Alert', () => {
backendServiceFailures: true,
});
- const screen = renderWithStoreAndRouter(
- ,
- {
- initialState: {
- ...initialState,
- featureToggles: {
- ...initialState.featureToggles,
- vaOnlineSchedulingVAOSServiceRequests: true,
- },
+ const screen = renderWithStoreAndRouter(, {
+ initialState: {
+ ...initialState,
+ featureToggles: {
+ ...initialState.featureToggles,
+ vaOnlineSchedulingVAOSServiceRequests: true,
},
},
- );
+ });
await waitFor(() => {
expect(screen.baseElement).to.contain.text('Cheyenne VA Medical Center');
@@ -451,18 +448,15 @@ describe('VAOS Backend Service Alert', () => {
backendServiceFailures: false,
});
- const screen = renderWithStoreAndRouter(
- ,
- {
- initialState: {
- ...initialState,
- featureToggles: {
- ...initialState.featureToggles,
- vaOnlineSchedulingVAOSServiceRequests: true,
- },
+ const screen = renderWithStoreAndRouter(, {
+ initialState: {
+ ...initialState,
+ featureToggles: {
+ ...initialState.featureToggles,
+ vaOnlineSchedulingVAOSServiceRequests: true,
},
},
- );
+ });
await waitFor(() => {
expect(screen.baseElement).to.contain.text('Cheyenne VA Medical Center');
diff --git a/src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/DetailsVA.jsx b/src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/DetailsVA.jsx
index 4076cdfb0e70..7ee7d2617173 100644
--- a/src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/DetailsVA.jsx
+++ b/src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/DetailsVA.jsx
@@ -1,21 +1,21 @@
-import React from 'react';
+import { VaAlert } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import PropTypes from 'prop-types';
+import React from 'react';
import { useSelector } from 'react-redux';
import { useParams } from 'react-router-dom';
import { shallowEqual } from 'recompose';
-import { VaAlert } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import BackLink from '../../../components/BackLink';
-import VAFacilityLocation from '../../../components/VAFacilityLocation';
-import { getVAAppointmentLocationId } from '../../../services/appointment';
-import { getConfirmedAppointmentDetailsInfo } from '../../redux/selectors';
-import { FETCH_STATUS } from '../../../utils/constants';
-import InPersonLayout from '../../../components/layout/InPersonLayout';
-import CancelWarningPage from '../cancel/CancelWarningPage';
-import CancelConfirmationPage from '../cancel/CancelConfirmationPage';
import FacilityAddress from '../../../components/FacilityAddress';
+import FullWidthLayout from '../../../components/FullWidthLayout';
import ClaimExamLayout from '../../../components/layout/ClaimExamLayout';
+import InPersonLayout from '../../../components/layout/InPersonLayout';
import PhoneLayout from '../../../components/layout/PhoneLayout';
-import FullWidthLayout from '../../../components/FullWidthLayout';
+import VAFacilityLocation from '../../../components/VAFacilityLocation';
+import { getVAAppointmentLocationId } from '../../../services/appointment';
+import { FETCH_STATUS } from '../../../utils/constants';
+import CancelConfirmationPage from '../../pages/CancelAppointmentPage/CancelConfirmationPage';
+import CancelWarningPage from '../../pages/CancelAppointmentPage/CancelWarningPage';
+import { getConfirmedAppointmentDetailsInfo } from '../../redux/selectors';
export default function DetailsVA({ appointment, facilityData }) {
const { id } = useParams();
diff --git a/src/applications/vaos/appointment-list/components/PastAppointmentsList/index.jsx b/src/applications/vaos/appointment-list/components/PastAppointmentsList/index.jsx
index 2f038a61c6a5..0c5a76fabae5 100644
--- a/src/applications/vaos/appointment-list/components/PastAppointmentsList/index.jsx
+++ b/src/applications/vaos/appointment-list/components/PastAppointmentsList/index.jsx
@@ -2,23 +2,23 @@ import React, { useEffect, useState } from 'react';
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
+import classNames from 'classnames';
import moment from 'moment';
import { useHistory } from 'react-router-dom';
-import classNames from 'classnames';
-import { getPastAppointmentListInfo } from '../../redux/selectors';
-import { FETCH_STATUS, GA_PREFIX } from '../../../utils/constants';
+import InfoAlert from '../../../components/InfoAlert';
+import { selectFeatureBreadcrumbUrlUpdate } from '../../../redux/selectors';
import { groupAppointmentByDay } from '../../../services/appointment';
-import NoAppointments from '../NoAppointments';
-import PastAppointmentsDateDropdown from './PastAppointmentsDateDropdown';
+import { FETCH_STATUS, GA_PREFIX } from '../../../utils/constants';
import { scrollAndFocus } from '../../../utils/scrollAndFocus';
-import InfoAlert from '../../../components/InfoAlert';
+import UpcomingAppointmentLayout from '../../pages/AppointmentsPage/UpcomingAppointmentLayout';
import {
fetchPastAppointments,
startNewAppointmentFlow,
} from '../../redux/actions';
-import { selectFeatureBreadcrumbUrlUpdate } from '../../../redux/selectors';
-import UpcomingAppointmentLayout from '../AppointmentsPage/UpcomingAppointmentLayout';
+import { getPastAppointmentListInfo } from '../../redux/selectors';
import BackendAppointmentServiceAlert from '../BackendAppointmentServiceAlert';
+import NoAppointments from '../NoAppointments';
+import PastAppointmentsDateDropdown from './PastAppointmentsDateDropdown';
export function getPastAppointmentDateRangeOptions(today = moment()) {
const startOfToday = today.clone().startOf('day');
diff --git a/src/applications/vaos/appointment-list/components/RequestedAppointmentsList.jsx b/src/applications/vaos/appointment-list/components/RequestedAppointmentsList.jsx
index 58fc232739ee..daf8a888bd04 100644
--- a/src/applications/vaos/appointment-list/components/RequestedAppointmentsList.jsx
+++ b/src/applications/vaos/appointment-list/components/RequestedAppointmentsList.jsx
@@ -1,17 +1,17 @@
-import React, { useEffect } from 'react';
+import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
import PropTypes from 'prop-types';
+import React, { useEffect } from 'react';
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
-import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
+import InfoAlert from '../../components/InfoAlert';
+import RequestAppointmentLayout from '../../components/RequestAppointmentLayout';
+import { FETCH_STATUS, GA_PREFIX } from '../../utils/constants';
+import { scrollAndFocus } from '../../utils/scrollAndFocus';
import {
fetchPendingAppointments,
startNewAppointmentFlow,
} from '../redux/actions';
import { getRequestedAppointmentListInfo } from '../redux/selectors';
-import { FETCH_STATUS, GA_PREFIX } from '../../utils/constants';
import NoAppointments from './NoAppointments';
-import InfoAlert from '../../components/InfoAlert';
-import { scrollAndFocus } from '../../utils/scrollAndFocus';
-import RequestAppointmentLayout from './AppointmentsPage/RequestAppointmentLayout';
export default function RequestedAppointmentsList({ hasTypeChanged }) {
const {
diff --git a/src/applications/vaos/appointment-list/index.jsx b/src/applications/vaos/appointment-list/index.jsx
index ee600d1a254c..dd6616284773 100644
--- a/src/applications/vaos/appointment-list/index.jsx
+++ b/src/applications/vaos/appointment-list/index.jsx
@@ -1,14 +1,14 @@
+import PageNotFound from '@department-of-veterans-affairs/platform-site-wide/PageNotFound';
import React from 'react';
-import { Switch, Route } from 'react-router-dom';
import { useSelector } from 'react-redux';
-import PageNotFound from '@department-of-veterans-affairs/platform-site-wide/PageNotFound';
-import AppointmentsPage from './components/AppointmentsPage/index';
-import RequestedAppointmentDetailsPage from './components/RequestedAppointmentDetailsPage';
-import ConfirmedAppointmentDetailsPage from './components/ConfirmedAppointmentDetailsPage';
+import { Route, Switch } from 'react-router-dom';
import useManualScrollRestoration from '../hooks/useManualScrollRestoration';
import { selectFeatureBreadcrumbUrlUpdate } from '../redux/selectors';
import { useIsInCCPilot } from '../referral-appointments/hooks/useIsInCCPilot';
import ReferralsAndRequests from '../referral-appointments/ReferralsAndRequests';
+import ConfirmedAppointmentDetailsPage from './components/ConfirmedAppointmentDetailsPage';
+import AppointmentsPage from './pages/AppointmentsPage/index';
+import RequestedAppointmentDetailsPage from './pages/RequestedAppointmentDetailsPage/RequestedAppointmentDetailsPage';
function AppointmentListSection() {
useManualScrollRestoration();
diff --git a/src/applications/vaos/appointment-list/index.unit.spec.js b/src/applications/vaos/appointment-list/index.unit.spec.js
index 66f5c172d672..fd2f53061872 100644
--- a/src/applications/vaos/appointment-list/index.unit.spec.js
+++ b/src/applications/vaos/appointment-list/index.unit.spec.js
@@ -3,9 +3,9 @@ import { expect } from 'chai';
import Sinon from 'sinon';
import { AppointmentList } from './index';
import { renderWithStoreAndRouter } from '../tests/mocks/setup';
-import * as AppointmentsPage from './components/AppointmentsPage/index';
+import * as AppointmentsPage from './pages/AppointmentsPage/index';
import * as ConfirmedAppointmentDetailsPage from './components/ConfirmedAppointmentDetailsPage';
-import * as RequestedAppointmentDetailsPage from './components/RequestedAppointmentDetailsPage';
+import * as RequestedAppointmentDetailsPage from './pages/RequestedAppointmentDetailsPage/RequestedAppointmentDetailsPage';
describe('VAOS Page: Appointment list routes', () => {
const sandbox = Sinon.createSandbox();
diff --git a/src/applications/vaos/appointment-list/components/AppointmentsPage/AppointmentColumnLayout.jsx b/src/applications/vaos/appointment-list/pages/AppointmentsPage/AppointmentColumnLayout.jsx
similarity index 100%
rename from src/applications/vaos/appointment-list/components/AppointmentsPage/AppointmentColumnLayout.jsx
rename to src/applications/vaos/appointment-list/pages/AppointmentsPage/AppointmentColumnLayout.jsx
diff --git a/src/applications/vaos/appointment-list/components/AppointmentsPage/AppointmentListItem.jsx b/src/applications/vaos/appointment-list/pages/AppointmentsPage/AppointmentListItem.jsx
similarity index 100%
rename from src/applications/vaos/appointment-list/components/AppointmentsPage/AppointmentListItem.jsx
rename to src/applications/vaos/appointment-list/pages/AppointmentsPage/AppointmentListItem.jsx
diff --git a/src/applications/vaos/appointment-list/components/AppointmentsPage/AppointmentListItemGroup.jsx b/src/applications/vaos/appointment-list/pages/AppointmentsPage/AppointmentListItemGroup.jsx
similarity index 100%
rename from src/applications/vaos/appointment-list/components/AppointmentsPage/AppointmentListItemGroup.jsx
rename to src/applications/vaos/appointment-list/pages/AppointmentsPage/AppointmentListItemGroup.jsx
diff --git a/src/applications/vaos/appointment-list/components/AppointmentsPage/RequestListItem.jsx b/src/applications/vaos/appointment-list/pages/AppointmentsPage/RequestListItem.jsx
similarity index 100%
rename from src/applications/vaos/appointment-list/components/AppointmentsPage/RequestListItem.jsx
rename to src/applications/vaos/appointment-list/pages/AppointmentsPage/RequestListItem.jsx
diff --git a/src/applications/vaos/appointment-list/components/AppointmentsPage/UpcomingAppointmentLayout.jsx b/src/applications/vaos/appointment-list/pages/AppointmentsPage/UpcomingAppointmentLayout.jsx
similarity index 100%
rename from src/applications/vaos/appointment-list/components/AppointmentsPage/UpcomingAppointmentLayout.jsx
rename to src/applications/vaos/appointment-list/pages/AppointmentsPage/UpcomingAppointmentLayout.jsx
diff --git a/src/applications/vaos/appointment-list/components/AppointmentsPage/index.jsx b/src/applications/vaos/appointment-list/pages/AppointmentsPage/index.jsx
similarity index 86%
rename from src/applications/vaos/appointment-list/components/AppointmentsPage/index.jsx
rename to src/applications/vaos/appointment-list/pages/AppointmentsPage/index.jsx
index 603613e922ee..d2dc9a9f9441 100644
--- a/src/applications/vaos/appointment-list/components/AppointmentsPage/index.jsx
+++ b/src/applications/vaos/appointment-list/pages/AppointmentsPage/index.jsx
@@ -1,35 +1,29 @@
-import React, { useEffect, useState } from 'react';
-import { useSelector, useDispatch } from 'react-redux';
-import { Switch, Route, useLocation, useHistory } from 'react-router-dom';
-import classNames from 'classnames';
import DowntimeNotification, {
externalServices,
} from '@department-of-veterans-affairs/platform-monitoring/DowntimeNotification';
+import classNames from 'classnames';
import PropTypes from 'prop-types';
-import {
- selectFeatureBreadcrumbUrlUpdate,
- // selectFeatureBookingExclusion,
-} from '../../../redux/selectors';
-import UpcomingAppointmentsList from '../UpcomingAppointmentsList';
-import PastAppointmentsList from '../PastAppointmentsList';
+import React, { useEffect, useState } from 'react';
+import { useDispatch, useSelector } from 'react-redux';
+import { Route, Switch, useHistory, useLocation } from 'react-router-dom';
+import CernerAlert from '../../../components/CernerAlert';
import WarningNotification from '../../../components/WarningNotification';
-import ScheduleNewAppointment from '../ScheduleNewAppointment';
-import PageLayout from '../PageLayout';
-import { selectPendingAppointments } from '../../redux/selectors';
-import {
- APPOINTMENT_STATUS,
- // OH_TRANSITION_SITES,
-} from '../../../utils/constants';
-import AppointmentListNavigation from '../AppointmentListNavigation';
+import { selectFeatureBreadcrumbUrlUpdate } from '../../../redux/selectors';
+import { APPOINTMENT_STATUS } from '../../../utils/constants';
import { scrollAndFocus } from '../../../utils/scrollAndFocus';
-import RequestedAppointmentsListGroup from '../RequestedAppointmentsListGroup';
-import CernerAlert from '../../../components/CernerAlert';
+import { selectPendingAppointments } from '../../redux/selectors';
+import RequestedAppointmentsPage from '../RequestedAppointmentsPage/RequestedAppointmentsPage';
// import CernerTransitionAlert from '../../../components/CernerTransitionAlert';
// import { selectPatientFacilities } from '~/platform/user/cerner-dsot/selectors';
import ReferralTaskCardWithReferral from '../../../referral-appointments/components/ReferralTaskCardWithReferral';
-import { setFormCurrentPage } from '../../../referral-appointments/redux/actions';
import { routeToCCPage } from '../../../referral-appointments/flow';
import { useIsInCCPilot } from '../../../referral-appointments/hooks/useIsInCCPilot';
+import { setFormCurrentPage } from '../../../referral-appointments/redux/actions';
+import AppointmentListNavigation from '../../components/AppointmentListNavigation';
+import PageLayout from '../../components/PageLayout';
+import PastAppointmentsListNew from '../../components/PastAppointmentsList';
+import ScheduleNewAppointment from '../../components/ScheduleNewAppointment';
+import UpcomingAppointmentsPage from '../UpcomingAppointmentsPage/UpcomingAppointmentsPage';
function renderWarningNotification() {
return (props, childContent) => {
@@ -192,13 +186,13 @@ export default function AppointmentsPage() {
/>
-
+
-
+
-
+
diff --git a/src/applications/vaos/appointment-list/components/AppointmentsPage/index.unit.spec.js b/src/applications/vaos/appointment-list/pages/AppointmentsPage/index.unit.spec.js
similarity index 100%
rename from src/applications/vaos/appointment-list/components/AppointmentsPage/index.unit.spec.js
rename to src/applications/vaos/appointment-list/pages/AppointmentsPage/index.unit.spec.js
diff --git a/src/applications/vaos/appointment-list/components/cancel/CancelConfirmationPage.jsx b/src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelConfirmationPage.jsx
similarity index 100%
rename from src/applications/vaos/appointment-list/components/cancel/CancelConfirmationPage.jsx
rename to src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelConfirmationPage.jsx
index 0779c3277f45..36145ceef5d3 100644
--- a/src/applications/vaos/appointment-list/components/cancel/CancelConfirmationPage.jsx
+++ b/src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelConfirmationPage.jsx
@@ -1,17 +1,17 @@
import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
-import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
+import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { useHistory } from 'react-router-dom/cjs/react-router-dom.min';
+import AppointmentCard from '../../../components/AppointmentCard';
+import BackLink from '../../../components/BackLink';
import { APPOINTMENT_TYPES, GA_PREFIX } from '../../../utils/constants';
import { startNewAppointmentFlow } from '../../redux/actions';
-import BackLink from '../../../components/BackLink';
// eslint-disable-next-line import/no-restricted-paths
import getNewAppointmentFlow from '../../../new-appointment/newAppointmentFlow';
import { scrollAndFocus } from '../../../utils/scrollAndFocus';
import { selectAppointmentType } from '../../redux/selectors';
import CancelPageContent from './CancelPageContent';
-import AppointmentCard from '../../../components/AppointmentCard';
function handleClick(history, dispatch, url) {
return e => {
diff --git a/src/applications/vaos/appointment-list/components/cancel/CancelPageContent.jsx b/src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelPageContent.jsx
similarity index 100%
rename from src/applications/vaos/appointment-list/components/cancel/CancelPageContent.jsx
rename to src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelPageContent.jsx
index 177a39003ab2..20eddd826709 100644
--- a/src/applications/vaos/appointment-list/components/cancel/CancelPageContent.jsx
+++ b/src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelPageContent.jsx
@@ -1,8 +1,8 @@
-import React from 'react';
import PropTypes from 'prop-types';
+import React from 'react';
import { APPOINTMENT_TYPES } from '../../../utils/constants';
-import CancelPageLayoutRequest from './CancelPageLayoutRequest';
import CancelPageLayout from './CancelPageLayout';
+import CancelPageLayoutRequest from './CancelPageLayoutRequest';
export default function CancelPageContent({ type }) {
if (
diff --git a/src/applications/vaos/appointment-list/components/cancel/CancelPageLayout.jsx b/src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelPageLayout.jsx
similarity index 98%
rename from src/applications/vaos/appointment-list/components/cancel/CancelPageLayout.jsx
rename to src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelPageLayout.jsx
index 03df536b2845..d774e91de186 100644
--- a/src/applications/vaos/appointment-list/components/cancel/CancelPageLayout.jsx
+++ b/src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelPageLayout.jsx
@@ -1,13 +1,9 @@
import React from 'react';
+import { useSelector } from 'react-redux';
import { useParams } from 'react-router-dom';
import { shallowEqual } from 'recompose';
-import { useSelector } from 'react-redux';
-import {
- getConfirmedAppointmentDetailsInfo,
- selectIsCanceled,
- selectIsInPerson,
- selectIsPhone,
-} from '../../redux/selectors';
+import Address from '../../../components/Address';
+import FacilityDirectionsLink from '../../../components/FacilityDirectionsLink';
import {
ClinicOrFacilityPhone,
Details,
@@ -16,12 +12,19 @@ import {
Where,
Who,
} from '../../../components/layout/DetailPageLayout';
-import Section from '../../../components/Section';
-import { AppointmentDate, AppointmentTime } from '../AppointmentDateTime';
import NewTabAnchor from '../../../components/NewTabAnchor';
+import Section from '../../../components/Section';
import { getRealFacilityId } from '../../../utils/appointment';
-import FacilityDirectionsLink from '../../../components/FacilityDirectionsLink';
-import Address from '../../../components/Address';
+import {
+ AppointmentDate,
+ AppointmentTime,
+} from '../../components/AppointmentDateTime';
+import {
+ getConfirmedAppointmentDetailsInfo,
+ selectIsCanceled,
+ selectIsInPerson,
+ selectIsPhone,
+} from '../../redux/selectors';
function getHeading(appointment) {
const isCanceled = selectIsCanceled(appointment);
diff --git a/src/applications/vaos/appointment-list/components/cancel/CancelPageLayoutRequest.jsx b/src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelPageLayoutRequest.jsx
similarity index 98%
rename from src/applications/vaos/appointment-list/components/cancel/CancelPageLayoutRequest.jsx
rename to src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelPageLayoutRequest.jsx
index 42179dd2db07..0de9c692f212 100644
--- a/src/applications/vaos/appointment-list/components/cancel/CancelPageLayoutRequest.jsx
+++ b/src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelPageLayoutRequest.jsx
@@ -5,16 +5,16 @@ import { useParams } from 'react-router-dom/cjs/react-router-dom.min';
import { shallowEqual } from 'recompose';
import Address from '../../../components/Address';
import FacilityPhone from '../../../components/FacilityPhone';
-import { selectRequestedAppointmentDetails } from '../../redux/selectors';
-import ListBestTimeToCall from '../ListBestTimeToCall';
import {
CCDetails,
Details,
} from '../../../components/layout/DetailPageLayout';
+import NewTabAnchor from '../../../components/NewTabAnchor';
import Section from '../../../components/Section';
-import { APPOINTMENT_STATUS } from '../../../utils/constants';
import { getRealFacilityId } from '../../../utils/appointment';
-import NewTabAnchor from '../../../components/NewTabAnchor';
+import { APPOINTMENT_STATUS } from '../../../utils/constants';
+import ListBestTimeToCall from '../../components/ListBestTimeToCall';
+import { selectRequestedAppointmentDetails } from '../../redux/selectors';
export default function CancelPageLayoutRequest() {
const { id } = useParams();
diff --git a/src/applications/vaos/appointment-list/components/cancel/CancelWarningPage.jsx b/src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelWarningPage.jsx
similarity index 100%
rename from src/applications/vaos/appointment-list/components/cancel/CancelWarningPage.jsx
rename to src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelWarningPage.jsx
index 2bba17708a06..bb1cce26b457 100644
--- a/src/applications/vaos/appointment-list/components/cancel/CancelWarningPage.jsx
+++ b/src/applications/vaos/appointment-list/pages/CancelAppointmentPage/CancelWarningPage.jsx
@@ -1,17 +1,17 @@
/* eslint-disable @department-of-veterans-affairs/prefer-button-component */
-import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
+import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
+import AppointmentCard from '../../../components/AppointmentCard';
import BackLink from '../../../components/BackLink';
+import { APPOINTMENT_TYPES } from '../../../utils/constants';
import { scrollAndFocus } from '../../../utils/scrollAndFocus';
import {
closeCancelAppointment,
confirmCancelAppointment,
} from '../../redux/actions';
import { selectAppointmentType } from '../../redux/selectors';
-import { APPOINTMENT_TYPES } from '../../../utils/constants';
import CancelPageContent from './CancelPageContent';
-import AppointmentCard from '../../../components/AppointmentCard';
function handleConfirm(dispatch) {
return () => dispatch(confirmCancelAppointment());
diff --git a/src/applications/vaos/appointment-list/components/RequestedAppointmentDetailsPage.jsx b/src/applications/vaos/appointment-list/pages/RequestedAppointmentDetailsPage/RequestedAppointmentDetailsPage.jsx
similarity index 81%
rename from src/applications/vaos/appointment-list/components/RequestedAppointmentDetailsPage.jsx
rename to src/applications/vaos/appointment-list/pages/RequestedAppointmentDetailsPage/RequestedAppointmentDetailsPage.jsx
index c9b718d6d31c..9b08c1e1f772 100644
--- a/src/applications/vaos/appointment-list/components/RequestedAppointmentDetailsPage.jsx
+++ b/src/applications/vaos/appointment-list/pages/RequestedAppointmentDetailsPage/RequestedAppointmentDetailsPage.jsx
@@ -1,23 +1,26 @@
+import { VaAlert } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import React, { useEffect } from 'react';
-import { useParams } from 'react-router-dom';
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
-import { VaAlert } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
-import BackLink from '../../components/BackLink';
-import { scrollAndFocus } from '../../utils/scrollAndFocus';
-import VAFacilityLocation from '../../components/VAFacilityLocation';
-import { selectRequestedAppointmentDetails } from '../redux/selectors';
-import { selectFeatureBreadcrumbUrlUpdate } from '../../redux/selectors';
-import ErrorMessage from '../../components/ErrorMessage';
-import PageLayout from './PageLayout';
-import FullWidthLayout from '../../components/FullWidthLayout';
-import { closeCancelAppointment, fetchRequestDetails } from '../redux/actions';
-import CancelWarningPage from './cancel/CancelWarningPage';
-import CancelConfirmationPage from './cancel/CancelConfirmationPage';
-import { FETCH_STATUS } from '../../utils/constants';
-import FacilityAddress from '../../components/FacilityAddress';
-import FacilityPhone from '../../components/FacilityPhone';
-import VARequestLayout from '../../components/layout/VARequestLayout';
-import CCRequestLayout from '../../components/layout/CCRequestLayout';
+import { useParams } from 'react-router-dom';
+import BackLink from '../../../components/BackLink';
+import ErrorMessage from '../../../components/ErrorMessage';
+import FacilityAddress from '../../../components/FacilityAddress';
+import FacilityPhone from '../../../components/FacilityPhone';
+import FullWidthLayout from '../../../components/FullWidthLayout';
+import CCRequestLayout from '../../../components/layout/CCRequestLayout';
+import VARequestLayout from '../../../components/layout/VARequestLayout';
+import VAFacilityLocation from '../../../components/VAFacilityLocation';
+import { selectFeatureBreadcrumbUrlUpdate } from '../../../redux/selectors';
+import { FETCH_STATUS } from '../../../utils/constants';
+import { scrollAndFocus } from '../../../utils/scrollAndFocus';
+import PageLayout from '../../components/PageLayout';
+import {
+ closeCancelAppointment,
+ fetchRequestDetails,
+} from '../../redux/actions';
+import { selectRequestedAppointmentDetails } from '../../redux/selectors';
+import CancelConfirmationPage from '../CancelAppointmentPage/CancelConfirmationPage';
+import CancelWarningPage from '../CancelAppointmentPage/CancelWarningPage';
export default function RequestedAppointmentDetailsPage() {
const { id } = useParams();
diff --git a/src/applications/vaos/appointment-list/components/RequestedAppointmentDetailsPage.unit.spec.js b/src/applications/vaos/appointment-list/pages/RequestedAppointmentDetailsPage/RequestedAppointmentDetailsPage.unit.spec.js
similarity index 97%
rename from src/applications/vaos/appointment-list/components/RequestedAppointmentDetailsPage.unit.spec.js
rename to src/applications/vaos/appointment-list/pages/RequestedAppointmentDetailsPage/RequestedAppointmentDetailsPage.unit.spec.js
index 914ac9ba6af6..46267efb34e2 100644
--- a/src/applications/vaos/appointment-list/components/RequestedAppointmentDetailsPage.unit.spec.js
+++ b/src/applications/vaos/appointment-list/pages/RequestedAppointmentDetailsPage/RequestedAppointmentDetailsPage.unit.spec.js
@@ -6,21 +6,21 @@ import { expect } from 'chai';
import MockDate from 'mockdate';
import moment from 'moment';
import React from 'react';
-import { AppointmentList } from '..';
-import { APPOINTMENT_STATUS, FETCH_STATUS } from '../../utils/constants';
-import MockAppointmentResponse from '../../tests/e2e/fixtures/MockAppointmentResponse';
-import MockFacilityResponse from '../../tests/e2e/fixtures/MockFacilityResponse';
-import { mockFacilityFetch } from '../../tests/mocks/fetch';
+import { AppointmentList } from '../..';
+import MockAppointmentResponse from '../../../tests/e2e/fixtures/MockAppointmentResponse';
+import MockFacilityResponse from '../../../tests/e2e/fixtures/MockFacilityResponse';
+import { mockFacilityFetch } from '../../../tests/mocks/fetch';
import {
mockAppointmentApi,
mockAppointmentUpdateApi,
mockAppointmentsApi,
-} from '../../tests/mocks/helpers';
+} from '../../../tests/mocks/helpers';
import {
createTestStore,
getTestDate,
renderWithStoreAndRouter,
-} from '../../tests/mocks/setup';
+} from '../../../tests/mocks/setup';
+import { APPOINTMENT_STATUS, FETCH_STATUS } from '../../../utils/constants';
describe('VAOS Page: RequestedAppointmentDetailsPage', () => {
const testDate = getTestDate();
diff --git a/src/applications/vaos/appointment-list/components/RequestedAppointmentsListGroup.jsx b/src/applications/vaos/appointment-list/pages/RequestedAppointmentsPage/RequestedAppointmentsPage.jsx
similarity index 88%
rename from src/applications/vaos/appointment-list/components/RequestedAppointmentsListGroup.jsx
rename to src/applications/vaos/appointment-list/pages/RequestedAppointmentsPage/RequestedAppointmentsPage.jsx
index d2c1ace289ba..2dddd704b3be 100644
--- a/src/applications/vaos/appointment-list/components/RequestedAppointmentsListGroup.jsx
+++ b/src/applications/vaos/appointment-list/pages/RequestedAppointmentsPage/RequestedAppointmentsPage.jsx
@@ -1,26 +1,26 @@
-import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
+import React, { useEffect } from 'react';
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
import classNames from 'classnames';
-import {
- fetchPendingAppointments,
- startNewAppointmentFlow,
-} from '../redux/actions';
-import { getRequestedAppointmentListInfo } from '../redux/selectors';
+import InfoAlert from '../../../components/InfoAlert';
import {
APPOINTMENT_STATUS,
FETCH_STATUS,
GA_PREFIX,
-} from '../../utils/constants';
-import NoAppointments from './NoAppointments';
-import InfoAlert from '../../components/InfoAlert';
-import { scrollAndFocus } from '../../utils/scrollAndFocus';
-import RequestAppointmentLayout from './AppointmentsPage/RequestAppointmentLayout';
-import BackendAppointmentServiceAlert from './BackendAppointmentServiceAlert';
+} from '../../../utils/constants';
+import { scrollAndFocus } from '../../../utils/scrollAndFocus';
+import RequestAppointmentLayout from '../../../components/RequestAppointmentLayout';
+import BackendAppointmentServiceAlert from '../../components/BackendAppointmentServiceAlert';
+import NoAppointments from '../../components/NoAppointments';
+import {
+ fetchPendingAppointments,
+ startNewAppointmentFlow,
+} from '../../redux/actions';
+import { getRequestedAppointmentListInfo } from '../../redux/selectors';
-export default function RequestedAppointmentsListGroup({ hasTypeChanged }) {
+export default function RequestedAppointmentsPage({ hasTypeChanged }) {
const {
pendingAppointments,
pendingStatus,
@@ -157,6 +157,6 @@ export default function RequestedAppointmentsListGroup({ hasTypeChanged }) {
);
}
-RequestedAppointmentsListGroup.propTypes = {
+RequestedAppointmentsPage.propTypes = {
hasTypeChanged: PropTypes.bool,
};
diff --git a/src/applications/vaos/appointment-list/components/RequestedAppointmentsListGroup.unit.spec.js b/src/applications/vaos/appointment-list/pages/RequestedAppointmentsPage/RequestedAppointmentsPage.unit.spec.js
similarity index 88%
rename from src/applications/vaos/appointment-list/components/RequestedAppointmentsListGroup.unit.spec.js
rename to src/applications/vaos/appointment-list/pages/RequestedAppointmentsPage/RequestedAppointmentsPage.unit.spec.js
index 1bbeafbaa5fb..52b75e87479f 100644
--- a/src/applications/vaos/appointment-list/components/RequestedAppointmentsListGroup.unit.spec.js
+++ b/src/applications/vaos/appointment-list/pages/RequestedAppointmentsPage/RequestedAppointmentsPage.unit.spec.js
@@ -1,13 +1,16 @@
-import React from 'react';
-import moment from 'moment';
-import MockDate from 'mockdate';
import { mockFetch } from '@department-of-veterans-affairs/platform-testing/helpers';
import { expect } from 'chai';
-import RequestedAppointmentsListGroup from './RequestedAppointmentsListGroup';
-import { getVAOSRequestMock } from '../../tests/mocks/mock';
-import reducers from '../../redux/reducer';
-import { mockVAOSAppointmentsFetch } from '../../tests/mocks/helpers';
-import { getTestDate, renderWithStoreAndRouter } from '../../tests/mocks/setup';
+import MockDate from 'mockdate';
+import moment from 'moment';
+import React from 'react';
+import reducers from '../../../redux/reducer';
+import { mockVAOSAppointmentsFetch } from '../../../tests/mocks/helpers';
+import { getVAOSRequestMock } from '../../../tests/mocks/mock';
+import {
+ getTestDate,
+ renderWithStoreAndRouter,
+} from '../../../tests/mocks/setup';
+import RequestedAppointmentsPage from './RequestedAppointmentsPage';
const initialStateVAOSService = {
featureToggles: {
@@ -104,15 +107,12 @@ describe('VAOS Component: RequestedAppointmentsList', () => {
});
// When veteran selects requested appointments
- const screen = renderWithStoreAndRouter(
- ,
- {
- initialState: {
- ...initialStateVAOSService,
- },
- reducers,
+ const screen = renderWithStoreAndRouter(, {
+ initialState: {
+ ...initialStateVAOSService,
},
- );
+ reducers,
+ });
// Then it should display the requested appointments
expect(await screen.findByText('Primary care')).to.be.ok;
@@ -194,15 +194,12 @@ describe('VAOS Component: RequestedAppointmentsList', () => {
});
// When veteran selects requested appointments
- const screen = renderWithStoreAndRouter(
- ,
- {
- initialState: {
- ...initialStateVAOSService,
- },
- reducers,
+ const screen = renderWithStoreAndRouter(, {
+ initialState: {
+ ...initialStateVAOSService,
},
- );
+ reducers,
+ });
// Then it should display the requested appointments
expect(await screen.findByText('Primary care')).to.be.ok;
@@ -238,15 +235,12 @@ describe('VAOS Component: RequestedAppointmentsList', () => {
});
// When veteran selects requested appointments
- const screen = renderWithStoreAndRouter(
- ,
- {
- initialState: {
- ...initialStateVAOSService,
- },
- reducers,
+ const screen = renderWithStoreAndRouter(, {
+ initialState: {
+ ...initialStateVAOSService,
},
- );
+ reducers,
+ });
// Then it should display the no appointments alert message
expect(
@@ -327,15 +321,12 @@ describe('VAOS Component: RequestedAppointmentsList', () => {
});
// When veteran selects requested appointments
- const screen = renderWithStoreAndRouter(
- ,
- {
- initialState: {
- ...initialStateVAOSService,
- },
- reducers,
+ const screen = renderWithStoreAndRouter(, {
+ initialState: {
+ ...initialStateVAOSService,
},
- );
+ reducers,
+ });
// Then it should display the requested appointments
expect(
diff --git a/src/applications/vaos/appointment-list/components/UpcomingAppointmentsList.jsx b/src/applications/vaos/appointment-list/pages/UpcomingAppointmentsPage/UpcomingAppointmentsPage.jsx
similarity index 84%
rename from src/applications/vaos/appointment-list/components/UpcomingAppointmentsList.jsx
rename to src/applications/vaos/appointment-list/pages/UpcomingAppointmentsPage/UpcomingAppointmentsPage.jsx
index 6f2171febe13..1bc60557b34f 100644
--- a/src/applications/vaos/appointment-list/components/UpcomingAppointmentsList.jsx
+++ b/src/applications/vaos/appointment-list/pages/UpcomingAppointmentsPage/UpcomingAppointmentsPage.jsx
@@ -1,24 +1,24 @@
-import React, { useEffect } from 'react';
-import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
-import moment from 'moment';
import classNames from 'classnames';
+import moment from 'moment';
+import React, { useEffect } from 'react';
+import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import { useHistory } from 'react-router-dom';
-import InfoAlert from '../../components/InfoAlert';
-import { getUpcomingAppointmentListInfo } from '../redux/selectors';
-import { FETCH_STATUS, GA_PREFIX } from '../../utils/constants';
-import { groupAppointmentByDay } from '../../services/appointment';
-import NoAppointments from './NoAppointments';
-import { scrollAndFocus } from '../../utils/scrollAndFocus';
+import InfoAlert from '../../../components/InfoAlert';
+import { selectFeatureBreadcrumbUrlUpdate } from '../../../redux/selectors';
+import { groupAppointmentByDay } from '../../../services/appointment';
+import { FETCH_STATUS, GA_PREFIX } from '../../../utils/constants';
+import { scrollAndFocus } from '../../../utils/scrollAndFocus';
+import BackendAppointmentServiceAlert from '../../components/BackendAppointmentServiceAlert';
+import NoAppointments from '../../components/NoAppointments';
import {
fetchFutureAppointments,
startNewAppointmentFlow,
-} from '../redux/actions';
-import { selectFeatureBreadcrumbUrlUpdate } from '../../redux/selectors';
-import UpcomingAppointmentLayout from './AppointmentsPage/UpcomingAppointmentLayout';
-import BackendAppointmentServiceAlert from './BackendAppointmentServiceAlert';
+} from '../../redux/actions';
+import { getUpcomingAppointmentListInfo } from '../../redux/selectors';
+import UpcomingAppointmentLayout from '../AppointmentsPage/UpcomingAppointmentLayout';
-export default function UpcomingAppointmentsList() {
+export default function UpcomingAppointmentsPage() {
const history = useHistory();
const dispatch = useDispatch();
const {
diff --git a/src/applications/vaos/appointment-list/components/UpcomingAppointmentsList.unit.spec.js b/src/applications/vaos/appointment-list/pages/UpcomingAppointmentsPage/UpcomingAppointmentsPage.unit.spec.js
similarity index 96%
rename from src/applications/vaos/appointment-list/components/UpcomingAppointmentsList.unit.spec.js
rename to src/applications/vaos/appointment-list/pages/UpcomingAppointmentsPage/UpcomingAppointmentsPage.unit.spec.js
index 7e0b4a4d6647..40eaa1144238 100644
--- a/src/applications/vaos/appointment-list/components/UpcomingAppointmentsList.unit.spec.js
+++ b/src/applications/vaos/appointment-list/pages/UpcomingAppointmentsPage/UpcomingAppointmentsPage.unit.spec.js
@@ -1,16 +1,19 @@
-import React from 'react';
-import MockDate from 'mockdate';
+import { mockFetch } from '@department-of-veterans-affairs/platform-testing/helpers';
import { expect } from 'chai';
+import MockDate from 'mockdate';
import moment from 'moment';
-import { mockFetch } from '@department-of-veterans-affairs/platform-testing/helpers';
-import reducers from '../../redux/reducer';
-import { getTestDate, renderWithStoreAndRouter } from '../../tests/mocks/setup';
-import UpcomingAppointmentsList from './UpcomingAppointmentsList';
+import React from 'react';
+import reducers from '../../../redux/reducer';
import {
- mockVAOSAppointmentsFetch,
mockAppointmentsApi,
-} from '../../tests/mocks/helpers';
-import { getVAOSAppointmentMock } from '../../tests/mocks/mock';
+ mockVAOSAppointmentsFetch,
+} from '../../../tests/mocks/helpers';
+import { getVAOSAppointmentMock } from '../../../tests/mocks/mock';
+import {
+ getTestDate,
+ renderWithStoreAndRouter,
+} from '../../../tests/mocks/setup';
+import UpcomingAppointmentsPage from './UpcomingAppointmentsPage';
const initialState = {
featureToggles: {
@@ -85,7 +88,7 @@ describe('VAOS Component: UpcomingAppointmentsList', () => {
statuses: ['booked', 'arrived', 'fulfilled', 'cancelled'],
});
- const screen = renderWithStoreAndRouter(, {
+ const screen = renderWithStoreAndRouter(, {
initialState: myInitialState,
reducers,
});
@@ -136,7 +139,7 @@ describe('VAOS Component: UpcomingAppointmentsList', () => {
statuses: ['booked', 'arrived', 'fulfilled', 'cancelled'],
});
- const screen = renderWithStoreAndRouter(, {
+ const screen = renderWithStoreAndRouter(, {
initialState: myInitialState,
reducers,
});
@@ -188,7 +191,7 @@ describe('VAOS Component: UpcomingAppointmentsList', () => {
statuses: ['booked', 'arrived', 'fulfilled', 'cancelled'],
});
- const screen = renderWithStoreAndRouter(, {
+ const screen = renderWithStoreAndRouter(, {
initialState: myInitialState,
reducers,
});
@@ -238,7 +241,7 @@ describe('VAOS Component: UpcomingAppointmentsList', () => {
statuses: ['booked', 'arrived', 'fulfilled', 'cancelled'],
});
- const screen = renderWithStoreAndRouter(, {
+ const screen = renderWithStoreAndRouter(, {
initialState: myInitialState,
reducers,
});
@@ -291,7 +294,7 @@ describe('VAOS Component: UpcomingAppointmentsList', () => {
statuses: ['booked', 'arrived', 'fulfilled', 'cancelled'],
});
- const screen = renderWithStoreAndRouter(, {
+ const screen = renderWithStoreAndRouter(, {
initialState: myInitialState,
reducers,
});
diff --git a/src/applications/vaos/appointment-list/components/AppointmentsPage/RequestAppointmentLayout.jsx b/src/applications/vaos/components/RequestAppointmentLayout.jsx
similarity index 93%
rename from src/applications/vaos/appointment-list/components/AppointmentsPage/RequestAppointmentLayout.jsx
rename to src/applications/vaos/components/RequestAppointmentLayout.jsx
index 3a98b9aae70c..7ae29b775190 100644
--- a/src/applications/vaos/appointment-list/components/AppointmentsPage/RequestAppointmentLayout.jsx
+++ b/src/applications/vaos/components/RequestAppointmentLayout.jsx
@@ -1,23 +1,23 @@
-import React from 'react';
-import PropTypes from 'prop-types';
import classNames from 'classnames';
+import PropTypes from 'prop-types';
+import React from 'react';
import { useSelector } from 'react-redux';
-import AppointmentFlexGrid from '../../../components/AppointmentFlexGrid';
-import ListItem from '../../../components/ListItem';
-import AppointmentRow from '../../../components/AppointmentRow';
import {
selectAppointmentLocality,
+ selectApptDetailAriaText,
selectIsCanceled,
+ selectIsCommunityCare,
selectModalityIcon,
selectTypeOfCareName,
- selectApptDetailAriaText,
- selectIsCommunityCare,
-} from '../../redux/selectors';
+} from '../appointment-list/redux/selectors';
import {
selectFeatureBreadcrumbUrlUpdate,
selectFeatureCCDirectScheduling,
-} from '../../../redux/selectors';
-import AppointmentColumn from '../../../components/AppointmentColumn';
+} from '../redux/selectors';
+import AppointmentColumn from './AppointmentColumn';
+import AppointmentFlexGrid from './AppointmentFlexGrid';
+import AppointmentRow from './AppointmentRow';
+import ListItem from './ListItem';
export default function RequestAppointmentLayout({ appointment, index }) {
const appointmentLocality = useSelector(() =>
diff --git a/src/applications/vaos/new-appointment/components/ContactInfoPage.jsx b/src/applications/vaos/new-appointment/components/ContactInfoPage.jsx
index eb40bd672285..af1354fc804c 100644
--- a/src/applications/vaos/new-appointment/components/ContactInfoPage.jsx
+++ b/src/applications/vaos/new-appointment/components/ContactInfoPage.jsx
@@ -110,28 +110,6 @@ function ContactInformationParagraph() {
const phoneConfig = phoneUI('Your phone number');
const pageKey = 'contactInfo';
-function Description() {
- const flowType = useSelector(getFlowType);
-
- if (FLOW_TYPES.DIRECT === flowType)
- return (
- <>
-
-
- Want to update your contact information for more VA benefits and
- services?
-
-
- Go to your VA.gov profile (opens in new tab)
-
- .
-
- You can update your contact information for most of your
- benefits and services in your VA.gov profile.
-
-
- Go to your VA.gov profile (opens in new tab)
-
-
-
- )}
+
+
+ You can update your contact information for most of your benefits
+ and services in your VA.gov profile.
+
+
+ Go to your VA.gov profile (opens in new tab)
+
+
+
+
dispatch(routeToPreviousAppointmentPage(history, pageKey, data))
diff --git a/src/applications/vaos/new-appointment/components/ContactInfoPage.unit.spec.js b/src/applications/vaos/new-appointment/components/ContactInfoPage.unit.spec.js
index 1cf5b6b40fad..f998c93ba07f 100644
--- a/src/applications/vaos/new-appointment/components/ContactInfoPage.unit.spec.js
+++ b/src/applications/vaos/new-appointment/components/ContactInfoPage.unit.spec.js
@@ -12,7 +12,7 @@ import { FACILITY_TYPES, FLOW_TYPES } from '../../utils/constants';
describe('VAOS Page: ContactInfoPage', () => {
// Flaky test: https://github.com/department-of-veterans-affairs/va.gov-team/issues/82968
- it.skip('should accept email, phone, and preferred time and continue', async () => {
+ it('should accept email, phone, and preferred time and continue', async () => {
const store = createTestStore({
user: {
profile: {
@@ -40,7 +40,7 @@ describe('VAOS Page: ContactInfoPage', () => {
// it should display page heading and description
await waitFor(() => {
- expect(screen.history.push.called).to.be.true;
+ expect(screen.getByText(/How should we contact you\?/i)).to.be.ok;
});
expect(
screen.getByText(
@@ -50,7 +50,7 @@ describe('VAOS Page: ContactInfoPage', () => {
expect(
screen.getByText(
- /Want to update your contact information for more VA benefits and services\?/,
+ /You can update your contact information for most of your benefits and services in your VA.gov profile./,
),
).to.be.ok;
const button = await screen.findByText(/^Continue/);
diff --git a/src/applications/vaos/new-appointment/newAppointmentFlow.js b/src/applications/vaos/new-appointment/newAppointmentFlow.js
index ff7546089f95..8cc23a8b6e16 100644
--- a/src/applications/vaos/new-appointment/newAppointmentFlow.js
+++ b/src/applications/vaos/new-appointment/newAppointmentFlow.js
@@ -312,7 +312,7 @@ const flow = {
},
contactInfo: {
url: '/new-appointment/contact-info',
- label: 'Confirm your contact information',
+ label: 'How should we contact you?',
next: 'review',
},
review: {
@@ -375,10 +375,6 @@ export default function getNewAppointmentFlow(state) {
},
contactInfo: {
...flow.contactInfo,
- label:
- FLOW_TYPES.DIRECT === flowType
- ? 'Confirm your contact information'
- : 'How should we contact you?',
url: featureBreadcrumbUrlUpdate
? 'contact-information'
: '/new-appointment/contact-info',
diff --git a/src/applications/vaos/new-appointment/redux/reducer.js b/src/applications/vaos/new-appointment/redux/reducer.js
index 270f483f606b..ef3c2556c484 100644
--- a/src/applications/vaos/new-appointment/redux/reducer.js
+++ b/src/applications/vaos/new-appointment/redux/reducer.js
@@ -71,9 +71,7 @@ import { distanceBetween } from '../../utils/address';
import { isTypeOfCareSupported } from '../../services/location';
export const REASON_ADDITIONAL_INFO_TITLES = {
- request: 'Add any details you’d like to share with your provider.',
- direct:
- 'Please provide any additional details you’d like to share with your provider about this appointment.',
+ va: 'Add any details you’d like to share with your provider.',
ccRequest:
'Share any information that you think will help the provider prepare for your appointment. You don’t have to share anything if you don’t want to.',
};
@@ -657,10 +655,7 @@ export default function formReducer(state = initialState, action) {
let additionalInfoTitle = REASON_ADDITIONAL_INFO_TITLES.ccRequest;
if (formData.facilityType !== FACILITY_TYPES.COMMUNITY_CARE) {
- additionalInfoTitle =
- state.flowType === FLOW_TYPES.DIRECT
- ? REASON_ADDITIONAL_INFO_TITLES.direct
- : REASON_ADDITIONAL_INFO_TITLES.request;
+ additionalInfoTitle = REASON_ADDITIONAL_INFO_TITLES.va;
} else {
delete formData.reasonForAppointment;
}
diff --git a/src/applications/vaos/referral-appointments/ChooseDateAndTime.jsx b/src/applications/vaos/referral-appointments/ChooseDateAndTime.jsx
index d2b23dd9b43e..24b172a4758b 100644
--- a/src/applications/vaos/referral-appointments/ChooseDateAndTime.jsx
+++ b/src/applications/vaos/referral-appointments/ChooseDateAndTime.jsx
@@ -51,7 +51,7 @@ export const ChooseDateAndTime = props => {
) {
setLoading(false);
setFailed(true);
- scrollAndFocus('h2');
+ scrollAndFocus('h1');
}
},
[currentReferral.providerId, dispatch, providerFetchStatus, futureStatus],
@@ -71,19 +71,12 @@ export const ChooseDateAndTime = props => {
);
}
- if (failed) {
- return (
-
-
We’re sorry. We’ve run into a problem
-
- We’re having trouble getting your upcoming appointments. Please try
- again later.
-
-
- );
- }
return (
-
+ {
sandbox.restore();
});
it('should fetch provider or appointments from store if it exists and not call API', async () => {
- const screen = renderWithStoreAndRouter(
+ renderWithStoreAndRouter(
,
@@ -149,7 +149,6 @@ describe('VAOS ChoseDateAndTime component', () => {
store: createTestStore(initialFullState),
},
);
- expect(await screen.getByTestId('pick-heading')).to.exist;
sandbox.assert.notCalled(getProviderByIdModule.getProviderById);
sandbox.assert.notCalled(fetchAppointmentsModule.fetchAppointments);
});
diff --git a/src/applications/vaos/referral-appointments/ConfirmReferral.jsx b/src/applications/vaos/referral-appointments/ConfirmReferral.jsx
index b2fdcb841267..1f862894d675 100644
--- a/src/applications/vaos/referral-appointments/ConfirmReferral.jsx
+++ b/src/applications/vaos/referral-appointments/ConfirmReferral.jsx
@@ -6,8 +6,10 @@ import ReferralLayout from './components/ReferralLayout';
export default function ConfirmReferral(props) {
const { currentReferral } = props;
return (
-
-
Confirm Referral for {currentReferral.CategoryOfCare}
+
{currentReferral.UUID}
-
-
Referrals and requests
+
Find your requested appointments and community care referrals.
{`Your referring VA facility approved you for ${appointmentCountString} with a community care provider. You can now schedule your appointment with a community care provider.`}