forked from adamgibbons/ics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/set-date-with-utc-time
- Loading branch information
Showing
4 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,8 @@ const event = { | |
status: 'CONFIRMED', | ||
organizer: { name: 'Admin', email: '[email protected]' }, | ||
attendees: [ | ||
{ name: 'Adam Gibbons', email: '[email protected]', rsvp: true }, | ||
{ name: 'Brittany Seaton', email: '[email protected]', dir: 'https://linkedin.com/in/brittanyseaton' } | ||
{ name: 'Adam Gibbons', email: '[email protected]', rsvp: true, partstat: 'ACCEPTED', role: 'REQ-PARTICIPANT' }, | ||
{ name: 'Brittany Seaton', email: '[email protected]', dir: 'https://linkedin.com/in/brittanyseaton', role: 'OPT-PARTICIPANT' } | ||
] | ||
} | ||
|
||
|
@@ -60,8 +60,8 @@ ics.createEvent(event, (error, value) => { | |
// STATUS:CONFIRMED | ||
// CATEGORIES:10k races,Memorial Day Weekend,Boulder CO | ||
// ORGANIZER;CN=Admin:mailto:[email protected] | ||
// ATTENDEE;RSVP=TRUE;CN=Adam Gibbons:mailto:[email protected] | ||
// ATTENDEE;RSVP=FALSE;DIR=https://linkedin.com/in/brittanyseaton;CN=Brittany | ||
// ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Adam Gibbons:mailto:[email protected] | ||
// ATTENDEE;RSVP=FALSE;ROLE=OPT-PARTICIPANT;DIR=https://linkedin.com/in/brittanyseaton;CN=Brittany | ||
// Seaton:mailto:[email protected] | ||
// DURATION:PT6H30M | ||
// END:VEVENT | ||
|
@@ -216,7 +216,7 @@ The following properties are accepted: | |
| url | URL associated with event | `'http://www.mountainsunpub.com/'` | ||
| status | Three statuses are allowed: `TENTATIVE`, `CONFIRMED`, `CANCELLED` | `CONFIRMED` | ||
| organizer | Person organizing the event | `{ name: 'Adam Gibbons', email: '[email protected]', dir: 'https://linkedin.com/in/adamgibbons' }` | ||
| attendees | Persons invited to the event | `[{ name: 'Mo', email: '[email protected]', rsvp: true }, { name: 'Bo', email: '[email protected]', dir: 'https://twitter.com/bo1234' }]` | ||
| attendees | Persons invited to the event | `[{ name: 'Mo', email: '[email protected]', rsvp: true }, { name: 'Bo', email: '[email protected]', dir: 'https://twitter.com/bo1234', partstat: 'ACCEPTED', role: 'REQ-PARTICIPANT' }]` | ||
| categories | Categories associated with the event | `['hacknight', 'stout month']` | ||
| alarms | Alerts that can be set to trigger before, during, or after the event. The following `attach` properties work on Mac OS: Basso, Blow, Bottle, Frog, Funk, Glass, Hero, Morse, Ping, Pop, Purr, Sousumi, Submarine, Tink | `{ action: 'DISPLAY', trigger: [2000, 1, 4, 18, 30] }` OR `{ action: 'DISPLAY', trigger: { hours: 2, minutes: 30, before: true }` OR `{ action: 'DISPLAY', trigger: { hours: 2, minutes: 30, before: false }` OR `{ action: 'AUDIO', trigger: { hours: 2, minutes: 30, before: true }, repeat: 2, attachType: 'VALUE=URI', attach: 'Glass' }` | ||
| productId | Product which created ics, `PRODID` field | `'adamgibbons/ics'` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,46 @@ import { expect } from 'chai' | |
import { setContact } from '../../src/utils' | ||
|
||
describe('utils.setContact', () => { | ||
it('set a contact with role', () => { | ||
const contact = { name: 'm-vinc', email: '[email protected]' } | ||
const contactChair = Object.assign({role: 'CHAIR'}, contact) | ||
const contactRequired = Object.assign({role: 'REQ-PARTICIPANT' }, contact) | ||
const contactOptional = Object.assign({role: 'OPT-PARTICIPANT' }, contact) | ||
const contactNon = Object.assign({role: 'NON-PARTICIPANT' }, contact) | ||
expect(setContact(contactChair)) | ||
.to.equal(`RSVP=FALSE;ROLE=CHAIR;CN=m-vinc:mailto:[email protected]`) | ||
expect(setContact(contactRequired)) | ||
.to.equal(`RSVP=FALSE;ROLE=REQ-PARTICIPANT;CN=m-vinc:mailto:[email protected]`) | ||
expect(setContact(contactOptional)) | ||
.to.equal(`RSVP=FALSE;ROLE=OPT-PARTICIPANT;CN=m-vinc:mailto:[email protected]`) | ||
expect(setContact(contactNon)) | ||
.to.equal(`RSVP=FALSE;ROLE=NON-PARTICIPANT;CN=m-vinc:mailto:[email protected]`) | ||
expect(setContact(contact)) | ||
.to.equal(`RSVP=FALSE;CN=m-vinc:mailto:[email protected]`) | ||
}) | ||
it('set a contact with partstat', () => { | ||
const contact = { name: 'm-vinc', email: '[email protected]' } | ||
const contactUndefined = Object.assign({partstat: undefined}, contact) | ||
const contactNeedsAction = Object.assign({partstat: 'NEEDS-ACTION'}, contact) | ||
const contactAccepted = Object.assign({partstat: 'ACCEPTED'}, contact) | ||
const contactDeclined = Object.assign({partstat: 'DECLINED'}, contact) | ||
const contactTentative = Object.assign({contact, partstat: 'TENTATIVE'}, contact) | ||
|
||
expect(setContact(contactUndefined)) | ||
.to.equal('RSVP=FALSE;CN=m-vinc:mailto:[email protected]') | ||
|
||
expect(setContact(contactNeedsAction)) | ||
.to.equal('RSVP=FALSE;PARTSTAT=NEEDS-ACTION;CN=m-vinc:mailto:[email protected]') | ||
|
||
expect(setContact(contactDeclined)) | ||
.to.equal('RSVP=FALSE;PARTSTAT=DECLINED;CN=m-vinc:mailto:[email protected]') | ||
|
||
expect(setContact(contactTentative)) | ||
.to.equal('RSVP=FALSE;PARTSTAT=TENTATIVE;CN=m-vinc:mailto:[email protected]') | ||
|
||
expect(setContact(contactAccepted)) | ||
.to.equal('RSVP=FALSE;PARTSTAT=ACCEPTED;CN=m-vinc:mailto:[email protected]') | ||
}) | ||
it('sets a contact and defaults RSVP to false', () => { | ||
const contact1 = { | ||
name: 'Adam Gibbons', | ||
|