diff --git a/tests/resources/configurations.spec.ts b/tests/resources/configurations.spec.ts index 1cb62e0f..9eefb58a 100644 --- a/tests/resources/configurations.spec.ts +++ b/tests/resources/configurations.spec.ts @@ -24,20 +24,20 @@ describe('Configurations', () => { identifier: 'grant123', overrides: { apiUri: 'https://test.api.nylas.com', - headers: { override: 'foobar' } - } - }) + headers: { override: 'foobar' }, + }, + }); expect(apiClient.request).toHaveBeenCalledWith({ method: 'GET', path: '/v3/grants/grant123/scheduling/configurations', overrides: { apiUri: 'https://test.api.nylas.com', - headers: { override: 'foobar' } - } - }) - }) - }) + headers: { override: 'foobar' }, + }, + }); + }); + }); describe('find', () => { it('should call apiClient.request with correct params', async () => { @@ -46,87 +46,83 @@ describe('Configurations', () => { configurationId: 'configuration123', overrides: { apiUri: 'https://test.api.nylas.com', - headers: { override: 'foobar' } - } - }) + headers: { override: 'foobar' }, + }, + }); expect(apiClient.request).toHaveBeenCalledWith({ method: 'GET', path: '/v3/grants/grant123/scheduling/configurations/configuration123', overrides: { apiUri: 'https://test.api.nylas.com', - headers: { override: 'foobar' } - } - }) - }) - }) + headers: { override: 'foobar' }, + }, + }); + }); + }); describe('create', () => { it('should call apiClient.request with correct params', async () => { await configurations.create({ identifier: 'grant123', requestBody: { - "requiresSessionAuth": false, - "participants": [ + requiresSessionAuth: false, + participants: [ { - "name": "Test", - "email": "nylassdk@nylas.com", - "availability": { - "calendarIds": [ - "primary" - ] + name: 'Test', + email: 'nylassdk@nylas.com', + availability: { + calendarIds: ['primary'], }, - "booking": { - "calendarId": "primary" - } - } + booking: { + calendarId: 'primary', + }, + }, ], - "availability": { - "durationMinutes": 30 + availability: { + durationMinutes: 30, + }, + eventBooking: { + title: 'My test event', }, - "eventBooking": { - "title": "My test event" - } }, overrides: { apiUri: 'https://test.api.nylas.com', - headers: { override: 'foobar' } - } - }) + headers: { override: 'foobar' }, + }, + }); expect(apiClient.request).toHaveBeenCalledWith({ method: 'POST', path: '/v3/grants/grant123/scheduling/configurations', body: { - "requiresSessionAuth": false, - "participants": [ + requiresSessionAuth: false, + participants: [ { - "name": "Test", - "email": "nylassdk@nylas.com", - "availability": { - "calendarIds": [ - "primary" - ] + name: 'Test', + email: 'nylassdk@nylas.com', + availability: { + calendarIds: ['primary'], + }, + booking: { + calendarId: 'primary', }, - "booking": { - "calendarId": "primary" - } - } + }, ], - "availability": { - "durationMinutes": 30 + availability: { + durationMinutes: 30, + }, + eventBooking: { + title: 'My test event', }, - "eventBooking": { - "title": "My test event" - } }, overrides: { apiUri: 'https://test.api.nylas.com', - headers: { override: 'foobar' } - } - }) - }) - }) + headers: { override: 'foobar' }, + }, + }); + }); + }); describe('update', () => { it('should call apiClient.request with the correct params', async () => { @@ -135,30 +131,30 @@ describe('Configurations', () => { configurationId: 'configuration123', requestBody: { eventBooking: { - title: "Changed Title" - } + title: 'Changed Title', + }, }, overrides: { apiUri: 'https://test.api.nylas.com', - headers: { override: 'foobar' } - } - }) + headers: { override: 'foobar' }, + }, + }); expect(apiClient.request).toHaveBeenCalledWith({ method: 'PUT', path: '/v3/grants/grant123/scheduling/configurations/configuration123', body: { eventBooking: { - title: "Changed Title" - } + title: 'Changed Title', + }, }, overrides: { apiUri: 'https://test.api.nylas.com', - headers: { override: 'foobar' } - } - }) - }) - }) + headers: { override: 'foobar' }, + }, + }); + }); + }); describe('destroy', () => { it('should call apiClient.request with the correct params', async () => { @@ -167,18 +163,18 @@ describe('Configurations', () => { configurationId: 'configuration123', overrides: { apiUri: 'https://test.api.nylas.com', - headers: { override: 'foobar' } - } - }) + headers: { override: 'foobar' }, + }, + }); expect(apiClient.request).toHaveBeenCalledWith({ method: 'DELETE', path: '/v3/grants/grant123/scheduling/configurations/configuration123', overrides: { apiUri: 'https://test.api.nylas.com', - headers: { override: 'foobar' } - } - }) - }) - }) -}) \ No newline at end of file + headers: { override: 'foobar' }, + }, + }); + }); + }); +});