Skip to content

Commit

Permalink
Add role to Attendee contactSchema and add a test with valid event an…
Browse files Browse the repository at this point in the history
…d valid attendees
  • Loading branch information
ft-mvinc committed Mar 20, 2019
1 parent 3588abf commit 4bac6e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/schema/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const contactSchema = Joi.object().keys({
email: Joi.string().email(),
rsvp: Joi.boolean(),
dir: Joi.string().uri(),
partstat: Joi.string()
partstat: Joi.string(),
role: Joi.string()
})

const organizerSchema = Joi.object().keys({
Expand Down
11 changes: 11 additions & 0 deletions test/schema/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,17 @@ describe('.validateEvent', () => {
{ name: 'Brittany', email: '[email protected]' }]
}).error
expect(details.some(p => p.message === '"foo" is not allowed')).to.be.true

const res = validateEvent({
title: 'foo',
uid: 'foo',
start: [2018, 12, 1, 10, 30],
end: [2018, 12, 1, 11, 0],
attendees: [
{ name: 'toto', email: '[email protected]', role: 'REQ-PARTICIPANT', partstat: 'ACCEPTED' }
]
}).error
expect(res).to.be.null;
})
})
describe('may have one or more occurances of', () => {
Expand Down

0 comments on commit 4bac6e0

Please sign in to comment.