Skip to content

Commit

Permalink
Dependents | 81671: QA fixes (1st round) (#34064)
Browse files Browse the repository at this point in the history
* issue #8

* Remove deceased location view

* everything else

* tests round 1

* tests round 2

* tests round 3

* tests final

* clean up
  • Loading branch information
Midge-dev authored Jan 17, 2025
1 parent 8a2bd0b commit cf1bba7
Show file tree
Hide file tree
Showing 15 changed files with 527 additions and 160 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,28 @@ export const uiSchema = {
},
'ui:webComponentField': VaTextInputField,
},

state: {
'ui:title': 'State',
'ui:webComponentField': VaSelectField,
'ui:errorMessages': {
required: 'Select a state',
},
'ui:required': formData =>
!formData?.currentMarriageInformation?.outsideUsa,
'ui:options': {
hideIf: formData => formData?.currentMarriageInformation?.outsideUsa,
},
},
country: {
'ui:title': 'Country',
'ui:webComponentField': VaSelectField,
'ui:errorMessages': {
required: 'Select a state',
required: 'Select a country',
},
'ui:required': formData =>
formData?.currentMarriageInformation?.outsideUsa,
'ui:options': {
hideIf: form => form?.currentMarriageInformation?.outsideUsa,
hideIf: formData => !formData?.currentMarriageInformation?.outsideUsa,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ export const spouseMarriageHistoryOptions = {
!item?.endLocation?.location?.city ||
(item?.startLocation?.outsideUsa === false &&
!item?.startLocation?.location?.state) ||
(item?.startLocation?.outsideUsa === true &&
!item?.startLocation?.location?.country) ||
(item?.endLocation?.outsideUsa === false &&
!item?.endLocation?.location?.state),
!item?.endLocation?.location?.state) ||
(item?.endLocation?.outsideUsa === true &&
!item?.endLocation?.location?.country),
maxItems: 20,
text: {
summaryTitle: 'Review your spouse’s former marriages',
Expand Down Expand Up @@ -195,9 +199,7 @@ export const formerMarriageEndDatePage = {

export const formerMarriageStartLocationPage = {
uiSchema: {
...arrayBuilderItemSubsequentPageTitleUI(() => {
return 'Spouse’s former marriage';
}),
...arrayBuilderItemSubsequentPageTitleUI(() => 'Spouse’s former marriage'),
startLocation: {
'ui:title': 'Where did they get married?',
'ui:options': {
Expand All @@ -220,24 +222,35 @@ export const formerMarriageStartLocationPage = {
state: {
'ui:title': 'State',
'ui:webComponentField': VaSelectField,
'ui:required': (formData, index) => {
// See above comment
const isEditMode = formData?.startLocation?.outsideUsa;
const isAddMode =
formData?.spouseMarriageHistory?.[index]?.startLocation
?.outsideUsa;

return !isAddMode && !isEditMode;
'ui:errorMessages': {
required: 'Select a state',
},
'ui:required': (formData, index) =>
!(
formData?.spouseMarriageHistory?.[index]?.startLocation
?.outsideUsa || formData?.startLocation?.outsideUsa
),
'ui:options': {
hideIf: (formData, index) =>
// See above comment
formData?.startLocation?.outsideUsa ||
formData?.spouseMarriageHistory?.[index]?.startLocation
?.outsideUsa,
?.outsideUsa || formData?.startLocation?.outsideUsa,
},
},
country: {
'ui:title': 'Country',
'ui:webComponentField': VaSelectField,
'ui:errorMessages': {
required: 'Select a state',
required: 'Select a country',
},
'ui:required': (formData, index) =>
formData?.spouseMarriageHistory?.[index]?.startLocation
?.outsideUsa || formData?.startLocation?.outsideUsa,
'ui:options': {
hideIf: (formData, index) =>
!(
formData?.spouseMarriageHistory?.[index]?.startLocation
?.outsideUsa || formData?.startLocation?.outsideUsa
),
},
},
},
Expand All @@ -253,9 +266,7 @@ export const formerMarriageStartLocationPage = {

export const formerMarriageEndLocationPage = {
uiSchema: {
...arrayBuilderItemSubsequentPageTitleUI(() => {
return 'Spouse’s former marriage';
}),
...arrayBuilderItemSubsequentPageTitleUI(() => 'Spouse’s former marriage'),
endLocation: {
'ui:title': 'Where did the marriage end?',
'ui:options': {
Expand All @@ -281,22 +292,35 @@ export const formerMarriageEndLocationPage = {
state: {
'ui:title': 'State',
'ui:webComponentField': VaSelectField,
'ui:required': (formData, index) => {
// See above comment
const isEditMode = formData?.endLocation?.outsideUsa;
const isAddMode =
formData?.spouseMarriageHistory?.[index]?.endLocation?.outsideUsa;

return !isAddMode && !isEditMode;
'ui:errorMessages': {
required: 'Select a state',
},
'ui:required': (formData, index) =>
!(
formData?.spouseMarriageHistory?.[index]?.endLocation
?.outsideUsa || formData?.endLocation?.outsideUsa
),
'ui:options': {
hideIf: (formData, index) =>
// See above comment
formData?.endLocation?.outsideUsa ||
formData?.spouseMarriageHistory?.[index]?.endLocation?.outsideUsa,
formData?.spouseMarriageHistory?.[index]?.endLocation
?.outsideUsa || formData?.endLocation?.outsideUsa,
},
},
country: {
'ui:title': 'Country',
'ui:webComponentField': VaSelectField,
'ui:errorMessages': {
required: 'Select a state',
required: 'Select a country',
},
'ui:required': (formData, index) =>
formData?.spouseMarriageHistory?.[index]?.endLocation?.outsideUsa ||
formData?.endLocation?.outsideUsa,
'ui:options': {
hideIf: (formData, index) =>
!(
formData?.spouseMarriageHistory?.[index]?.endLocation
?.outsideUsa || formData?.endLocation?.outsideUsa
),
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ export const veteranMarriageHistoryOptions = {
!item?.endLocation?.location?.city ||
(item?.startLocation?.outsideUsa === false &&
!item?.startLocation?.location?.state) ||
(item?.startLocation?.outsideUsa === true &&
!item?.startLocation?.location?.country) ||
(item?.endLocation?.outsideUsa === false &&
!item?.endLocation?.location?.state),
!item?.endLocation?.location?.state) ||
(item?.endLocation?.outsideUsa === true &&
!item?.endLocation?.location?.country),
maxItems: 20,
text: {
getItemName: item =>
Expand Down Expand Up @@ -194,9 +198,7 @@ export const vetFormerMarriageEndDatePage = {

export const vetFormerMarriageStartLocationPage = {
uiSchema: {
...arrayBuilderItemSubsequentPageTitleUI(() => {
return 'Your former marriage';
}),
...arrayBuilderItemSubsequentPageTitleUI(() => 'Your former marriage'),
startLocation: {
'ui:title': 'Where did they get married?',
'ui:options': {
Expand All @@ -219,24 +221,35 @@ export const vetFormerMarriageStartLocationPage = {
state: {
'ui:title': 'State',
'ui:webComponentField': VaSelectField,
'ui:required': (formData, index) => {
// See above comment
const isEditMode = formData?.startLocation?.outsideUsa;
const isAddMode =
formData?.veteranMarriageHistory?.[index]?.startLocation
?.outsideUsa;

return !isAddMode && !isEditMode;
'ui:errorMessages': {
required: 'Select a state',
},
'ui:required': (formData, index) =>
!(
formData?.veteranMarriageHistory?.[index]?.startLocation
?.outsideUsa || formData?.startLocation?.outsideUsa
),
'ui:options': {
hideIf: (formData, index) =>
// See above comment
formData?.startLocation?.outsideUsa ||
formData?.veteranMarriageHistory?.[index]?.startLocation
?.outsideUsa,
?.outsideUsa || formData?.startLocation?.outsideUsa,
},
},
country: {
'ui:title': 'Country',
'ui:webComponentField': VaSelectField,
'ui:errorMessages': {
required: 'Select a state',
required: 'Select a country',
},
'ui:required': (formData, index) =>
formData?.veteranMarriageHistory?.[index]?.startLocation
?.outsideUsa || formData?.startLocation?.outsideUsa,
'ui:options': {
hideIf: (formData, index) =>
!(
formData?.veteranMarriageHistory?.[index]?.startLocation
?.outsideUsa || formData?.startLocation?.outsideUsa
),
},
},
},
Expand All @@ -252,9 +265,7 @@ export const vetFormerMarriageStartLocationPage = {

export const vetFormerMarriageEndLocationPage = {
uiSchema: {
...arrayBuilderItemSubsequentPageTitleUI(() => {
return 'Your former marriage';
}),
...arrayBuilderItemSubsequentPageTitleUI(() => 'Your former marriage'),
endLocation: {
'ui:title': 'Where did the marriage end?',
'ui:options': {
Expand All @@ -280,24 +291,35 @@ export const vetFormerMarriageEndLocationPage = {
state: {
'ui:title': 'State',
'ui:webComponentField': VaSelectField,
'ui:required': (formData, index) => {
// See above comment
const isEditMode = formData?.endLocation?.outsideUsa;
const isAddMode =
formData?.veteranMarriageHistory?.[index]?.endLocation
?.outsideUsa;

return !isAddMode && !isEditMode;
'ui:errorMessages': {
required: 'Select a state',
},
'ui:required': (formData, index) =>
!(
formData?.veteranMarriageHistory?.[index]?.endLocation
?.outsideUsa || formData?.endLocation?.outsideUsa
),
'ui:options': {
hideIf: (formData, index) =>
// See above comment
formData?.endLocation?.outsideUsa ||
formData?.veteranMarriageHistory?.[index]?.endLocation
?.outsideUsa,
?.outsideUsa || formData?.endLocation?.outsideUsa,
},
},
country: {
'ui:title': 'Country',
'ui:webComponentField': VaSelectField,
'ui:errorMessages': {
required: 'Select a state',
required: 'Select a country',
},
'ui:required': (formData, index) =>
formData?.veteranMarriageHistory?.[index]?.endLocation
?.outsideUsa || formData?.endLocation?.outsideUsa,
'ui:options': {
hideIf: (formData, index) =>
!(
formData?.veteranMarriageHistory?.[index]?.endLocation
?.outsideUsa || formData?.endLocation?.outsideUsa
),
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,32 @@ export const placeOfBirth = {
state: {
'ui:title': 'State',
'ui:webComponentField': VaSelectField,
'ui:required': formData => {
return formData?.birthLocation?.outsideUsa;
},
'ui:errorMessages': {
required: 'Select a state',
},
'ui:options': {
hideIf: formData => {
return formData?.birthLocation?.outsideUsa;
},
hideIf: formData => formData?.birthLocation?.outsideUsa,
},
'ui:required': formData => !formData?.birthLocation?.outsideUsa,
},
country: {
'ui:title': 'Country',
'ui:webComponentField': VaSelectField,
'ui:errorMessages': {
required: 'Select a country',
},
'ui:options': {
hideIf: formData => !formData?.birthLocation?.outsideUsa,
},
'ui:required': formData => formData?.birthLocation?.outsideUsa,
},
postalCode: {
'ui:title': 'Postal Code',
'ui:webComponentField': VaTextInputField,
'ui:required': formData => {
return !formData?.birthLocation?.outsideUsa;
},
'ui:errorMessages': {
required: 'Enter a postal code',
},
'ui:required': formData => !formData?.birthLocation?.outsideUsa,
},
},
},
Expand Down
Loading

0 comments on commit cf1bba7

Please sign in to comment.