@@ -24,7 +24,12 @@ import { TeamRepositoryFixture } from "test/fixtures/repository/team.repository.
24
24
import { UserRepositoryFixture } from "test/fixtures/repository/users.repository.fixture" ;
25
25
import { withApiAuth } from "test/utils/withApiAuth" ;
26
26
27
- import { SUCCESS_STATUS , VERSION_2024_06_11 , CAL_API_VERSION_HEADER } from "@calcom/platform-constants" ;
27
+ import {
28
+ SUCCESS_STATUS ,
29
+ VERSION_2024_06_11 ,
30
+ VERSION_2024_04_15 ,
31
+ CAL_API_VERSION_HEADER ,
32
+ } from "@calcom/platform-constants" ;
28
33
import {
29
34
EventTypesByViewer ,
30
35
EventTypesPublic ,
@@ -154,6 +159,7 @@ describe("Event types Endpoints", () => {
154
159
155
160
return request ( app . getHttpServer ( ) )
156
161
. post ( "/api/v2/event-types" )
162
+ . set ( CAL_API_VERSION_HEADER , VERSION_2024_04_15 )
157
163
. send ( body )
158
164
. expect ( 201 )
159
165
. then ( async ( response ) => {
@@ -184,6 +190,7 @@ describe("Event types Endpoints", () => {
184
190
185
191
return request ( app . getHttpServer ( ) )
186
192
. patch ( `/api/v2/event-types/${ eventType . id } ` )
193
+ . set ( CAL_API_VERSION_HEADER , VERSION_2024_04_15 )
187
194
. send ( body )
188
195
. expect ( 200 )
189
196
. then ( async ( response ) => {
@@ -288,6 +295,7 @@ describe("Event types Endpoints", () => {
288
295
it ( `/GET/:id` , async ( ) => {
289
296
const response = await request ( app . getHttpServer ( ) )
290
297
. get ( `/api/v2/event-types/${ eventType . id } ` )
298
+ . set ( CAL_API_VERSION_HEADER , VERSION_2024_04_15 )
291
299
// note: bearer token value mocked using "withApiAuth" for user which id is used when creating event type above
292
300
. set ( "Authorization" , `Bearer whatever` )
293
301
. expect ( 200 ) ;
@@ -323,6 +331,7 @@ describe("Event types Endpoints", () => {
323
331
it ( `/GET/:username/public` , async ( ) => {
324
332
const response = await request ( app . getHttpServer ( ) )
325
333
. get ( `/api/v2/event-types/${ username } /public` )
334
+ . set ( CAL_API_VERSION_HEADER , VERSION_2024_04_15 )
326
335
// note: bearer token value mocked using "withApiAuth" for user which id is used when creating event type above
327
336
. set ( "Authorization" , `Bearer whatever` )
328
337
. expect ( 200 ) ;
@@ -341,6 +350,7 @@ describe("Event types Endpoints", () => {
341
350
it ( `/GET/:username/:eventSlug/public` , async ( ) => {
342
351
const response = await request ( app . getHttpServer ( ) )
343
352
. get ( `/api/v2/event-types/${ username } /${ eventType . slug } /public` )
353
+ . set ( CAL_API_VERSION_HEADER , VERSION_2024_04_15 )
344
354
// note: bearer token value mocked using "withApiAuth" for user which id is used when creating event type above
345
355
. set ( "Authorization" , `Bearer whatever` )
346
356
. expect ( 200 ) ;
@@ -358,6 +368,7 @@ describe("Event types Endpoints", () => {
358
368
it ( `/GET/` , async ( ) => {
359
369
const response = await request ( app . getHttpServer ( ) )
360
370
. get ( `/api/v2/event-types` )
371
+ . set ( CAL_API_VERSION_HEADER , VERSION_2024_04_15 )
361
372
// note: bearer token value mocked using "withApiAuth" for user which id is used when creating event type above
362
373
. set ( "Authorization" , `Bearer whatever` )
363
374
. expect ( 200 ) ;
@@ -377,6 +388,7 @@ describe("Event types Endpoints", () => {
377
388
it ( `/GET/public/:username/` , async ( ) => {
378
389
const response = await request ( app . getHttpServer ( ) )
379
390
. get ( `/api/v2/event-types/${ username } /public` )
391
+ . set ( CAL_API_VERSION_HEADER , VERSION_2024_04_15 )
380
392
// note: bearer token value mocked using "withApiAuth" for user which id is used when creating event type above
381
393
. set ( "Authorization" , `Bearer whatever` )
382
394
. expect ( 200 ) ;
@@ -393,13 +405,17 @@ describe("Event types Endpoints", () => {
393
405
it ( `/GET/:id not existing` , async ( ) => {
394
406
await request ( app . getHttpServer ( ) )
395
407
. get ( `/api/v2/event-types/1000` )
408
+ . set ( CAL_API_VERSION_HEADER , VERSION_2024_04_15 )
396
409
// note: bearer token value mocked using "withApiAuth" for user which id is used when creating event type above
397
410
. set ( "Authorization" , `Bearer whatever` )
398
411
. expect ( 404 ) ;
399
412
} ) ;
400
413
401
414
it ( "should delete schedule" , async ( ) => {
402
- return request ( app . getHttpServer ( ) ) . delete ( `/api/v2/event-types/${ eventType . id } ` ) . expect ( 200 ) ;
415
+ return request ( app . getHttpServer ( ) )
416
+ . delete ( `/api/v2/event-types/${ eventType . id } ` )
417
+ . set ( CAL_API_VERSION_HEADER , VERSION_2024_04_15 )
418
+ . expect ( 200 ) ;
403
419
} ) ;
404
420
405
421
afterAll ( async ( ) => {
0 commit comments