Skip to content

Commit

Permalink
schema: add education[].summary
Browse files Browse the repository at this point in the history
  • Loading branch information
heitorPB committed Dec 9, 2020
1 parent 7095651 commit 173432e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@
"type": "string",
"description": "grade point average, e.g. 3.67/4.0"
},
"summary": {
"type": "string",
"description": "a short summary of your studies, e.g. Thesis"
},
"courses": {
"type": "array",
"description": "List notable courses/subjects",
Expand Down
14 changes: 14 additions & 0 deletions test/__test__/education.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,20 @@
}
]
},
"summaryValid": {
"education": [
{
"summary": "I wrote an awesome Master's Thesis."
}
]
},
"summaryInvalid": {
"education": [
{
"summary": null
}
]
},
"coursesValid": {
"education": [
{
Expand Down
16 changes: 16 additions & 0 deletions test/education.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,22 @@ test('education[].score - invalid', (t) => {
t.end();
});

test('education[].summary - valid', (t) => {
validate(fixtures.summaryValid, (err, valid) => {
t.equal(err, null, 'err should be null');
t.true(valid, 'valid is true');
});
t.end();
});

test('education[].summary - invalid', (t) => {
validate(fixtures.summaryInvalid, (err, valid) => {
t.notEqual(err, null, 'err should contain an error');
t.false(valid, 'valid is false');
});
t.end();
});

test('education[].courses - valid', (t) => {
validate(fixtures.coursesValid, (err, valid) => {
t.equal(err, null, 'err should be null');
Expand Down

0 comments on commit 173432e

Please sign in to comment.