Skip to content

Commit

Permalink
Adds test for rescheduling an appointment
Browse files Browse the repository at this point in the history
  • Loading branch information
willik committed Oct 30, 2019
1 parent 58aab04 commit 88642e9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/resources/appointment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,22 @@ it('can conditionally not set a filter', async () => {

expected.toHaveProperty('filters', {});
});

it('can reschedule an appointment with new start time', async () => {
const resource = new Appointment(mockAxios);
const start = '2018-01-01 12:00:00';

await resource
.starting(start)
.reschedule(1);

expect(mockAxios.patch).toHaveBeenCalledTimes(1);
expect(mockAxios.patch).toHaveBeenCalledWith('appointments/1', {
data: {
attributes: {
start,
},
type: 'appointments',
},
});
});

0 comments on commit 88642e9

Please sign in to comment.