Skip to content

Commit

Permalink
58745 Switch to optional fields for va-medical-records page
Browse files Browse the repository at this point in the history
  • Loading branch information
christinec-fftc committed Jun 12, 2023
1 parent bf2d274 commit 37ed578
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
11 changes: 2 additions & 9 deletions dist/21-526EZ-ALLCLAIMS-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,6 @@
},
"vaTreatmentCenterAddress": {
"type": "object",
"required": [
"country"
],
"properties": {
"country": {
"$ref": "#/definitions/country"
Expand Down Expand Up @@ -987,14 +984,10 @@
},
"vaTreatmentFacilities": {
"type": "array",
"minItems": 1,
"minItems": 0,
"maxItems": 100,
"items": {
"type": "object",
"required": [
"treatmentCenterName",
"treatedDisabilityNames"
],
"properties": {
"treatmentCenterName": {
"type": "string",
Expand All @@ -1009,7 +1002,7 @@
},
"treatedDisabilityNames": {
"type": "array",
"minItems": 1,
"minItems": 0,
"maxItems": 100,
"items": {
"type": "string"
Expand Down
6 changes: 2 additions & 4 deletions src/schemas/21-526EZ-allclaims/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const vaTreatmentCenterAddressDef = (addressSchema => {
const { type, properties } = addressSchema;
return {
type,
required: ['country'],
properties: _.pick(['country', 'city', 'state'], properties),
};
})(baseAddressDef);
Expand Down Expand Up @@ -455,11 +454,10 @@ const schema = {
},
vaTreatmentFacilities: {
type: 'array',
minItems: 1,
minItems: 0,
maxItems: 100,
items: {
type: 'object',
required: ['treatmentCenterName', 'treatedDisabilityNames'],
properties: {
treatmentCenterName: {
type: 'string',
Expand All @@ -474,7 +472,7 @@ const schema = {
},
treatedDisabilityNames: {
type: 'array',
minItems: 1,
minItems: 0,
maxItems: 100,
items: {
type: 'string',
Expand Down
26 changes: 17 additions & 9 deletions test/schemas/21-526EZ/schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,8 @@ const data = {
],
},
vaTreatmentCenterAddress: {
valid: [{ country: 'USA' }, { country: 'Spain', city: 'abc' }, { country: 'Spain', city: 'xyz', state: 'AL' }],
invalid: [
{},
{ country: 'XYZ' },
{ country: 'Spain', state: 'AB' },
{ state: 'AL' },
{ country: 'USA', city: 1234 },
],
valid: [{}, { country: 'USA' }, { country: 'Spain', city: 'abc' }, { country: 'Spain', city: 'xyz', state: 'AL' }],
invalid: [{ country: 'XYZ' }, { country: 'Spain', state: 'AB' }, { country: 'USA', city: 1234 }],
},
homelessOrAtRisk: {
valid: ['no', 'homeless', 'atRisk'],
Expand All @@ -335,8 +329,22 @@ const data = {
vaTreatmentCenterAddress: { country: 'USA' },
},
],
[][{}],
],
invalid: [
{
treatmentCenterName: makeString(100, 'abc123'),
treatedDisabilityNames: ['xyz'],
treatmentDateRange: fixtures.dateRange,
vaTreatmentCenterAddress: { country: 'nowhere' },
},
{
treatmentCenterName: makeString(100, 'abc123'),
treatedDisabilityNames: ['xyz'],
treatmentDateRange: fixtures.dateRange,
vaTreatmentCenterAddress: { state: 'nope' },
},
],
invalid: [[], [{}], [{ treatmentCenterName: 1234 }], [{ treatmentCenterName: 'foo', treatedDisabilityNames: [] }]],
},
bankAccountType: {
valid: ['Checking', 'Savings'],
Expand Down

0 comments on commit 37ed578

Please sign in to comment.