-
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.
Adds ability to send a booked through origin when adding an attendee …
…to an appointment
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 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 |
---|---|---|
|
@@ -412,6 +412,34 @@ it('can add the given attendee to the given appointment with notification meta d | |
}); | ||
}); | ||
|
||
it('can add the given attendee to the given appointment with booked through meta data', async () => { | ||
const resource = new Appointment(mockAxios); | ||
const attendee = (new Attendee()).named('Jane', 'Doe').reachable({ email: '[email protected]' }); | ||
|
||
await resource.with(attendee).through(Origins.MODERN_CLIENT_VIEW).add(1); | ||
|
||
expect(mockAxios.put).toHaveBeenCalledTimes(1); | ||
expect(mockAxios.put).toHaveBeenCalledWith('appointments/1/attendees', { | ||
data: [ | ||
{ | ||
attributes: { | ||
email: '[email protected]', | ||
first_name: 'Jane', | ||
last_name: 'Doe', | ||
}, | ||
type: 'attendees', | ||
} | ||
], | ||
meta: { | ||
origin: Origins.MODERN_CLIENT_VIEW, | ||
}, | ||
}, { | ||
headers: { | ||
'Content-Type': 'application/json; ext=bulk', | ||
}, | ||
}); | ||
}); | ||
|
||
it('can add the given attendee to the given appointment while supplying answers', async () => { | ||
const resource = new Appointment(mockAxios); | ||
const answer = (new Answer()).for(1).is('the value'); | ||
|
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