-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements initial version of appointment resource
- Loading branch information
1 parent
d74b703
commit 630c5b7
Showing
4 changed files
with
89 additions
and
6 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 |
---|---|---|
@@ -1 +1,51 @@ | ||
import Appointment from './appointment'; | ||
import Attendee from '../models/attendee'; | ||
import { AppointmentNotificationParameters } from '../types/parameters'; | ||
|
||
it('can set the location property', async () => { | ||
const appointment = new Appointment; | ||
|
||
expect(appointment.at(1)).toHaveProperty('location', 1); | ||
}); | ||
|
||
it('can set the user property', async () => { | ||
const appointment = new Appointment; | ||
|
||
expect(appointment.by(1)).toHaveProperty('user', 1); | ||
}); | ||
|
||
it('can set the service property using a single number', async () => { | ||
const appointment = new Appointment; | ||
|
||
expect(appointment.for(1)).toHaveProperty('services', 1); | ||
}); | ||
|
||
it('can set the service property using a multiple numbers', async () => { | ||
const appointment = new Appointment; | ||
|
||
expect(appointment.for([1, 2])).toHaveProperty('services', [1, 2]); | ||
}); | ||
|
||
it('can set the notifications property', async () => { | ||
const appointment = new Appointment; | ||
const notifications: AppointmentNotificationParameters = { | ||
client: true, | ||
user: true, | ||
}; | ||
|
||
expect(appointment.notify(notifications)).toHaveProperty('notifications', notifications); | ||
}); | ||
|
||
it('can set a single attendee for the appointment', async () => { | ||
const appointment = new Appointment; | ||
const attendee = new Attendee; | ||
|
||
expect(appointment.with(attendee)).toHaveProperty('attendees', [attendee]); | ||
}); | ||
|
||
it('can set multiple attendees for the appointment', async () => { | ||
const appointment = new Appointment; | ||
const attendee = new Attendee; | ||
|
||
expect(appointment.with([attendee, attendee])).toHaveProperty('attendees', [attendee, attendee]); | ||
}); |
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