Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dist/22-10272-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,10 @@
},
"vaBenefitProgram": {
"type": "string",
"minLength": 1,
"maxLength": 500
"enum": [
"chapter33",
"chapter35"
]
},
"testName": {
"type": "string",
Expand Down
3 changes: 1 addition & 2 deletions src/schemas/22-10272/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ const schema = {
},
vaBenefitProgram: {
type: 'string',
minLength: 1,
maxLength: 500,
enum: ['chapter33', 'chapter35'],
},

// PART III - LICENSING OR CERTIFICATION TEST
Expand Down
47 changes: 10 additions & 37 deletions test/schemas/22-10272/schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,8 @@ const testData = {
],
},
vaBenefitProgram: {
valid: [
'Previously applied for Chapter 33',
'Used Chapter 33 and Chapter 35 in the past',
],
invalid: [
'',
null,
longString501,
],
valid: ['chapter33', 'chapter35'],
invalid: ['', null, longString501],
},
vaFileNumber: {
valid: ['796111863', '123456789'],
Expand Down Expand Up @@ -140,9 +133,7 @@ const testData = {

describe('22-10272 schema property validations', () => {
// Strip out cross-field logic for unit-style property tests
const validationHelper = new SchemaTestHelper(
omit(schemaClone, ['required', 'oneOf']),
);
const validationHelper = new SchemaTestHelper(omit(schemaClone, ['required', 'oneOf']));

validationHelper.testValidAndInvalid('applicantName', testData.applicantName);
validationHelper.testValidAndInvalid('organizationName', testData.organizationName);
Expand All @@ -151,33 +142,15 @@ describe('22-10272 schema property validations', () => {
validationHelper.testValidAndInvalid('mailingAddress', testData.mailingAddress);
validationHelper.testValidAndInvalid('vaBenefitProgram', testData.vaBenefitProgram);
validationHelper.testValidAndInvalid('vaFileNumber', testData.vaFileNumber);
validationHelper.testValidAndInvalid(
'statementOfTruthSignature',
testData.statementOfTruthSignature,
);
validationHelper.testValidAndInvalid('statementOfTruthSignature', testData.statementOfTruthSignature);
validationHelper.testValidAndInvalid('dateSigned', testData.dateSigned);

validationHelper.testValidAndInvalid('prepCourseName', testData.prepCourseName);
validationHelper.testValidAndInvalid(
'prepCourseOrganizationName',
testData.prepCourseOrganizationName,
);
validationHelper.testValidAndInvalid(
'prepCourseOrganizationAddress',
testData.prepCourseOrganizationAddress,
);
validationHelper.testValidAndInvalid(
'prepCourseTakenOnline',
testData.prepCourseTakenOnline,
);
validationHelper.testValidAndInvalid(
'prepCourseStartDate',
testData.prepCourseStartDate,
);
validationHelper.testValidAndInvalid(
'prepCourseEndDate',
testData.prepCourseEndDate,
);
validationHelper.testValidAndInvalid('prepCourseOrganizationName', testData.prepCourseOrganizationName);
validationHelper.testValidAndInvalid('prepCourseOrganizationAddress', testData.prepCourseOrganizationAddress);
validationHelper.testValidAndInvalid('prepCourseTakenOnline', testData.prepCourseTakenOnline);
validationHelper.testValidAndInvalid('prepCourseStartDate', testData.prepCourseStartDate);
validationHelper.testValidAndInvalid('prepCourseEndDate', testData.prepCourseEndDate);
validationHelper.testValidAndInvalid('prepCourseCost', testData.prepCourseCost);
validationHelper.testValidAndInvalid('remarks', testData.remarks);
});
Expand Down Expand Up @@ -226,7 +199,7 @@ describe('22-10272 schema cross-field validations', () => {
const payload = {
...base,
hasPreviouslyApplied: true,
vaBenefitProgram: 'Previously applied for Chapter 33 benefits',
vaBenefitProgram: 'chapter33',
};

expect(schemaTestHelper.validateSchema(payload)).to.equal(true);
Expand Down
Loading