diff --git a/src/models/attendee.test.ts b/src/models/attendee.test.ts index 42d5bd1..c509578 100644 --- a/src/models/attendee.test.ts +++ b/src/models/attendee.test.ts @@ -52,6 +52,16 @@ it('can set that an attendee is messagable', async () => { ); }); +it('can set that an attendee is not messagable', async () => { + const attendee = new Attendee(); + + expect(attendee.messagable(false).getAttributes()).toEqual( + expect.objectContaining({ + messagable: false, + }), + ); +}); + it('can set an attendees first and last name', async () => { const attendee = new Attendee(); diff --git a/src/models/attendee.ts b/src/models/attendee.ts index 2063d53..4ffdae2 100644 --- a/src/models/attendee.ts +++ b/src/models/attendee.ts @@ -7,7 +7,7 @@ export interface AttendeeModel extends ModelInterface { located(details: LocatableDetailParameters): this; - messagable(): this; + messagable(messageable: boolean): this; named(first: string, last: string): this; @@ -80,8 +80,8 @@ export default class Attendee extends Model implements AttendeeModel { return this; } - public messagable(): this { - this.attributes.messagable = true; + public messagable(messageable: boolean = true): this { + this.attributes.messagable = messageable; return this; }