diff --git a/src/applications/simple-forms/form-upload/config/form.js b/src/applications/simple-forms/form-upload/config/form.js index ea2e4ecbbd64..170d86de4908 100644 --- a/src/applications/simple-forms/form-upload/config/form.js +++ b/src/applications/simple-forms/form-upload/config/form.js @@ -18,6 +18,7 @@ import { VeteranIdentificationInformationPage, veteranIdentificationInformationPage, } from '../pages/veteranIdentificationInformation'; +import { phoneNumberAndEmailPage } from '../pages/phoneNumberAndEmail'; import { CustomTopContent } from '../pages/helpers'; // mock-data import for local development @@ -92,6 +93,18 @@ const formConfig = (pathname = null) => { }, }, }, + contactInformationChapter: { + title: 'Your contact information', + pages: { + phoneNumberAndEmailPage: { + path: 'phone-number-and-email', + title: 'Phone and email address', + uiSchema: phoneNumberAndEmailPage.uiSchema, + schema: phoneNumberAndEmailPage.schema, + scrollAndFocusTarget, + }, + }, + }, uploadChapter: { title: 'Upload', pages: { diff --git a/src/applications/simple-forms/form-upload/pages/phoneNumberAndEmail.jsx b/src/applications/simple-forms/form-upload/pages/phoneNumberAndEmail.jsx new file mode 100644 index 000000000000..e4dc25fce6e9 --- /dev/null +++ b/src/applications/simple-forms/form-upload/pages/phoneNumberAndEmail.jsx @@ -0,0 +1,24 @@ +import { + emailSchema, + emailToSendNotificationsUI, + phoneSchema, + phoneUI, + titleUI, +} from 'platform/forms-system/src/js/web-component-patterns'; + +/** @type {PageSchema} */ +export const phoneNumberAndEmailPage = { + uiSchema: { + ...titleUI('Phone and email address'), + phoneNumber: phoneUI(), + email: emailToSendNotificationsUI(), + }, + schema: { + type: 'object', + properties: { + phoneNumber: phoneSchema, + email: emailSchema, + }, + required: ['email'], + }, +}; diff --git a/src/applications/simple-forms/form-upload/tests/e2e/fixtures/data/veteran.json b/src/applications/simple-forms/form-upload/tests/e2e/fixtures/data/veteran.json index 92da1e04016e..d4e3dad617ea 100644 --- a/src/applications/simple-forms/form-upload/tests/e2e/fixtures/data/veteran.json +++ b/src/applications/simple-forms/form-upload/tests/e2e/fixtures/data/veteran.json @@ -11,7 +11,12 @@ "state": "CA", "postalCode": "12345" }, - "idNumber": { "ssn": "234232345", "vaFileNumber": "456454567" }, + "phoneNumber": "1231231234", + "email": "john@veteran.com", + "idNumber": { + "ssn": "234232345", + "vaFileNumber": "456454567" + }, "uploadedFile": { "confirmationCode": "03d52b41-bc92-4830-beda-dfc3c2669af4", "name": "Mock File", @@ -20,4 +25,4 @@ "warnings": [] } } -} +} \ No newline at end of file diff --git a/src/applications/simple-forms/form-upload/tests/e2e/form-upload.cypress.spec.js b/src/applications/simple-forms/form-upload/tests/e2e/form-upload.cypress.spec.js index f04d42433a14..679996a3c6a4 100644 --- a/src/applications/simple-forms/form-upload/tests/e2e/form-upload.cypress.spec.js +++ b/src/applications/simple-forms/form-upload/tests/e2e/form-upload.cypress.spec.js @@ -91,6 +91,17 @@ const testConfig = createTestConfig( }); }); }, + 'phone-number-and-email': ({ afterHook }) => { + afterHook(() => { + cy.get('@testData').then(data => { + fillTextWebComponent('phoneNumber', data.phoneNumber); + fillTextWebComponent('email', data.email); + cy.findAllByText(/^Continue/, { selector: 'button' }) + .last() + .click(); + }); + }); + }, upload: ({ afterHook }) => { afterHook(() => { cy.axeCheck('.form-panel');