-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add required email for 0845 (#33425)
- Loading branch information
1 parent
4d9d33c
commit fb59971
Showing
9 changed files
with
131 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 11 additions & 20 deletions
31
src/applications/simple-forms/21-0845/pages/authorizerContactInfo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,22 @@ | ||
import definitions from 'vets-json-schema/dist/definitions.json'; | ||
import { | ||
emailToSendNotificationsSchema, | ||
emailToSendNotificationsUI, | ||
phoneSchema, | ||
phoneUI, | ||
} from 'platform/forms-system/src/js/web-component-patterns'; | ||
|
||
/** @type {PageSchema} */ | ||
export default { | ||
uiSchema: { | ||
authorizerPhone: { | ||
'ui:title': 'Phone number', | ||
'ui:errorMessages': { | ||
required: 'Please enter a phone number.', | ||
pattern: | ||
'Please enter a 10-digit phone number (with or without dashes).', | ||
}, | ||
}, | ||
authorizerEmail: { | ||
'ui:title': 'Email address', | ||
'ui:widget': 'email', | ||
'ui:errorMessages': { | ||
format: | ||
'Enter a valid email address using the format [email protected]. Your email address can only have letters, numbers, the @ symbol and a period, with no spaces.', | ||
}, | ||
}, | ||
authorizerPhone: phoneUI(), | ||
authorizerEmail: emailToSendNotificationsUI(), | ||
}, | ||
schema: { | ||
type: 'object', | ||
required: ['authorizerPhone'], | ||
required: ['authorizerPhone', 'authorizerEmail'], | ||
properties: { | ||
authorizerPhone: definitions.phone, | ||
authorizerEmail: definitions.email, | ||
authorizerPhone: phoneSchema, | ||
authorizerEmail: emailToSendNotificationsSchema, | ||
}, | ||
}, | ||
}; |
22 changes: 22 additions & 0 deletions
22
src/applications/simple-forms/21-0845/pages/veteranContactInfo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { | ||
emailToSendNotificationsSchema, | ||
emailToSendNotificationsUI, | ||
phoneSchema, | ||
phoneUI, | ||
} from 'platform/forms-system/src/js/web-component-patterns'; | ||
|
||
/** @type {PageSchema} */ | ||
export default { | ||
uiSchema: { | ||
veteranPhone: phoneUI(), | ||
veteranEmail: emailToSendNotificationsUI(), | ||
}, | ||
schema: { | ||
type: 'object', | ||
required: ['veteranEmail'], | ||
properties: { | ||
veteranPhone: phoneSchema, | ||
veteranEmail: emailToSendNotificationsSchema, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
"postalCode": "12345" | ||
}, | ||
"authorizerPhone": "5555555555", | ||
"authorizerEmail": "[email protected]", | ||
"veteranFullName": { | ||
"first": "John", | ||
"middle": "", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
"middle": "", | ||
"last": "Veteran" | ||
}, | ||
"veteranEmail": "[email protected]", | ||
"veteranPhone": "5555555555", | ||
"veteranDateOfBirth": "2000-01-01", | ||
"veteranSSN": "111223333", | ||
"thirdPartyType": "person", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,14 @@ | |
"postalCode": "12345" | ||
}, | ||
"authorizerPhone": "5555555555", | ||
"authorizerEmail": "[email protected]", | ||
"veteranFullName": { | ||
"first": "John", | ||
"middle": "", | ||
"last": "Veteran" | ||
}, | ||
"veteranEmail": "[email protected]", | ||
"veteranPhone": "5555555555", | ||
"veteranDateOfBirth": "2000-01-01", | ||
"veteranSSN": "111223333", | ||
"thirdPartyType": "organization", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/applications/simple-forms/21-0845/tests/pages/veteranContactInfo.unit.spec.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { | ||
testNumberOfErrorsOnSubmit, | ||
testNumberOfErrorsOnSubmitForWebComponents, | ||
testNumberOfFields, | ||
testNumberOfWebComponentFields, | ||
} from '../../../shared/tests/pages/pageTests.spec'; | ||
import formConfig from '../../config/form'; | ||
|
||
const { | ||
schema, | ||
uiSchema, | ||
} = formConfig.chapters.veteranContactInfoChapter.pages.vetContactInfoPage; | ||
|
||
const pageTitle = 'Your contact information'; | ||
|
||
const expectedNumberOfFields = 0; | ||
testNumberOfFields( | ||
formConfig, | ||
schema, | ||
uiSchema, | ||
expectedNumberOfFields, | ||
pageTitle, | ||
); | ||
|
||
const expectedNumberOfErrors = 0; | ||
testNumberOfErrorsOnSubmit( | ||
formConfig, | ||
schema, | ||
uiSchema, | ||
expectedNumberOfErrors, | ||
pageTitle, | ||
); | ||
|
||
const expectedNumberOfWebComponentFields = 2; | ||
testNumberOfWebComponentFields( | ||
formConfig, | ||
schema, | ||
uiSchema, | ||
expectedNumberOfWebComponentFields, | ||
pageTitle, | ||
); | ||
|
||
const expectedNumberOfWebComponentErrors = 1; | ||
testNumberOfErrorsOnSubmitForWebComponents( | ||
formConfig, | ||
schema, | ||
uiSchema, | ||
expectedNumberOfWebComponentErrors, | ||
pageTitle, | ||
); |