Skip to content

Commit

Permalink
Adds messagable attribute setter
Browse files Browse the repository at this point in the history
  • Loading branch information
coconutcraig committed Nov 17, 2018
1 parent 3c253ab commit 7c84776
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/models/attendee.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,13 @@ it('can set location detail parameters and maintain existing attributes', async
})
);
});

it('can set that an attendee is messagable', async () => {
const attendee = new Attendee;

expect(attendee.messagable().getAttributes()).toEqual(
expect.objectContaining({
messagable: true,
})
);
});
2 changes: 2 additions & 0 deletions src/models/attendee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export default class Attendee extends Model implements AttendeeModel {
}

public messagable(): this {
this.attributes.messagable = true;

return this;
}

Expand Down
1 change: 1 addition & 0 deletions src/types/parameters.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface AttendeeParameters {
email: string | null;
first_name: string | null;
last_name: string | null;
messagable?: boolean;
phone?: string;
postcode?: string;
region?: string;
Expand Down

0 comments on commit 7c84776

Please sign in to comment.