diff --git a/schema.json b/schema.json index 75e7a56..b83dfa3 100644 --- a/schema.json +++ b/schema.json @@ -196,6 +196,15 @@ "type": "object", "additionalProperties": true, "properties": { + "degrees": { + "type": "array", + "description": "Degrees/certificates awarded from this institution", + "additionalItems": false, + "items": { + "type": "string", + "description": "e.g. Bachelor of Science in Circus Performance" + } + }, "institution": { "type": "string", "description": "e.g. Massachusetts Institute of Technology" diff --git a/test/__test__/education.json b/test/__test__/education.json index 5b2b86d..8f5e4df 100644 --- a/test/__test__/education.json +++ b/test/__test__/education.json @@ -148,5 +148,37 @@ ] } ] + }, + "degreesValid": { + "education": [ + { + "degrees": [] + } + ] + }, + "degreesInvalid": { + "education": [ + { + "degrees": null + } + ] + }, + "degreesItemValid": { + "education": [ + { + "degrees": [ + "Master of Science in Circus Performance" + ] + } + ] + }, + "degreesItemInvalid": { + "education": [ + { + "degrees": [ + null + ] + } + ] } } diff --git a/test/education.spec.js b/test/education.spec.js index 8303721..109e56f 100644 --- a/test/education.spec.js +++ b/test/education.spec.js @@ -177,3 +177,35 @@ test('education[].courses[item] - invalid', (t) => { }); t.end(); }); + +test('education[].degrees - valid', (t) => { + validate(fixtures.degreesValid, (err, valid) => { + t.equal(err, null, 'err should be null'); + t.true(valid, 'valid is true'); + }); + t.end(); +}); + +test('education[].degrees - invalid', (t) => { + validate(fixtures.degreesInvalid, (err, valid) => { + t.notEqual(err, null, 'err should contain an error'); + t.false(valid, 'valid is false'); + }); + t.end(); +}); + +test('education[].degrees[item] - valid', (t) => { + validate(fixtures.degreesItemValid, (err, valid) => { + t.equal(err, null, 'err should be null'); + t.true(valid, 'valid is true'); + }); + t.end(); +}); + +test('education[].degrees[item] - invalid', (t) => { + validate(fixtures.degreesItemInvalid, (err, valid) => { + t.notEqual(err, null, 'err should contain an error'); + t.false(valid, 'valid is false'); + }); + t.end(); +});