Skip to content

Commit

Permalink
Merge branch 'main' into mc-breadcrumbs-v1-medical-copays
Browse files Browse the repository at this point in the history
  • Loading branch information
micahchiang committed Mar 13, 2024
2 parents ee1f992 + c8bdf23 commit 077db74
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react';
import PropTypes from 'prop-types';
import merge from 'lodash/merge';
import fullSchemaPensions from 'vets-json-schema/dist/21P-527EZ-schema.json';

import { titleUI } from 'platform/forms-system/src/js/web-component-patterns';
import currentOrPastDateUI from 'platform/forms-system/src/js/definitions/currentOrPastDate';
import fullNameUI from 'platform/forms/definitions/fullName';
import {
dateOfBirthUI,
dateOfBirthSchema,
fullNameUI,
fullNameSchema,
titleUI,
} from 'platform/forms-system/src/js/web-component-patterns';
import ListItemView from '../../../components/ListItemView';
import { DependentsMinItem, formatFullName } from '../../../helpers';

const { dependents } = fullSchemaPensions.properties;

const DependentNameView = ({ formData }) => (
<ListItemView title={formatFullName(formData.fullName)} />
);
Expand Down Expand Up @@ -40,21 +40,8 @@ export default {
minItems: DependentsMinItem,
},
items: {
fullName: merge({}, fullNameUI, {
first: {
'ui:title': 'Child’s first name',
},
last: {
'ui:title': 'Child’s last name',
},
middle: {
'ui:title': 'Child’s middle name',
},
suffix: {
'ui:title': 'Child’s suffix',
},
}),
childDateOfBirth: currentOrPastDateUI('Date of birth'),
fullName: fullNameUI(title => `Child’s ${title}`),
childDateOfBirth: dateOfBirthUI(),
},
},
},
Expand All @@ -68,8 +55,8 @@ export default {
type: 'object',
required: ['fullName', 'childDateOfBirth'],
properties: {
fullName: dependents.items.properties.fullName,
childDateOfBirth: dependents.items.properties.childDateOfBirth,
fullName: fullNameSchema,
childDateOfBirth: dateOfBirthSchema,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
testNumberOfErrorsOnSubmit,
testNumberOfFields,
testNumberOfErrorsOnSubmitForWebComponents,
testNumberOfWebComponentFields,
} from '../pageTests.spec';
import careExpenses from '../../../../config/chapters/04-household-information/dependentChildren';

Expand All @@ -10,8 +10,8 @@ const { schema, uiSchema } = careExpenses;

describe('Add dependent children page', () => {
const pageTitle = 'Add dependent children';
const expectedNumberOfFields = 7;
testNumberOfFields(
const expectedNumberOfFields = 5;
testNumberOfWebComponentFields(
formConfig,
schema,
uiSchema,
Expand All @@ -20,7 +20,7 @@ describe('Add dependent children page', () => {
);

const expectedNumberOfErrors = 3;
testNumberOfErrorsOnSubmit(
testNumberOfErrorsOnSubmitForWebComponents(
formConfig,
schema,
uiSchema,
Expand Down

0 comments on commit 077db74

Please sign in to comment.