@@ -318,6 +318,74 @@ describe('Calendars', () => {
318318 } ,
319319 } ) ;
320320 } ) ;
321+
322+ it ( 'should call apiClient.request with tentativeAsBusy parameter' , async ( ) => {
323+ await calendars . getAvailability ( {
324+ requestBody : {
325+ startTime : 123 ,
326+ endTime : 456 ,
327+ participants : [ ] ,
328+ durationMinutes : 30 ,
329+ intervalMinutes : 15 ,
330+ availabilityRules : {
331+ availabilityMethod : AvailabilityMethod . MaxAvailability ,
332+ buffer : {
333+ before : 15 ,
334+ after : 15 ,
335+ } ,
336+ defaultOpenHours : [
337+ {
338+ days : [ 0 ] ,
339+ timezone : 'America/Toronto' ,
340+ start : '09:00' ,
341+ end : '17:00' ,
342+ exdates : [ '2020-01-01' ] ,
343+ } ,
344+ ] ,
345+ roundRobinEventId : 'event123' ,
346+ tentativeAsBusy : false , // Don't treat tentative events as busy
347+ } ,
348+ } ,
349+ overrides : {
350+ apiUri : 'https://test.api.nylas.com' ,
351+ headers : { override : 'bar' } ,
352+ } ,
353+ } ) ;
354+
355+ expect ( apiClient . request ) . toHaveBeenCalledWith ( {
356+ method : 'POST' ,
357+ path : '/v3/calendars/availability' ,
358+ body : {
359+ startTime : 123 ,
360+ endTime : 456 ,
361+ participants : [ ] ,
362+ durationMinutes : 30 ,
363+ intervalMinutes : 15 ,
364+ availabilityRules : {
365+ availabilityMethod : AvailabilityMethod . MaxAvailability ,
366+ buffer : {
367+ before : 15 ,
368+ after : 15 ,
369+ } ,
370+ defaultOpenHours : [
371+ {
372+ days : [ 0 ] ,
373+ timezone : 'America/Toronto' ,
374+ start : '09:00' ,
375+ end : '17:00' ,
376+ exdates : [ '2020-01-01' ] ,
377+ } ,
378+ ] ,
379+ roundRobinEventId : 'event123' ,
380+ tentativeAsBusy : false , // Don't treat tentative events as busy
381+ } ,
382+ } ,
383+ overrides : {
384+ apiUri : 'https://test.api.nylas.com' ,
385+ headers : { override : 'bar' } ,
386+ } ,
387+ } ) ;
388+ } ) ;
321389 } ) ;
322390
323391 describe ( 'getCollectiveAvailability' , ( ) => {
0 commit comments