Skip to content

Commit ffae288

Browse files
committed
test: old v2 even-types request with VERSION_2024_04_15
1 parent 6dc17c6 commit ffae288

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

apps/api/v2/src/ee/event-types/event-types_2024_04_15/controllers/event-types.controller.e2e-spec.ts

+18-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ import { TeamRepositoryFixture } from "test/fixtures/repository/team.repository.
2424
import { UserRepositoryFixture } from "test/fixtures/repository/users.repository.fixture";
2525
import { withApiAuth } from "test/utils/withApiAuth";
2626

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";
2833
import {
2934
EventTypesByViewer,
3035
EventTypesPublic,
@@ -154,6 +159,7 @@ describe("Event types Endpoints", () => {
154159

155160
return request(app.getHttpServer())
156161
.post("/api/v2/event-types")
162+
.set(CAL_API_VERSION_HEADER, VERSION_2024_04_15)
157163
.send(body)
158164
.expect(201)
159165
.then(async (response) => {
@@ -184,6 +190,7 @@ describe("Event types Endpoints", () => {
184190

185191
return request(app.getHttpServer())
186192
.patch(`/api/v2/event-types/${eventType.id}`)
193+
.set(CAL_API_VERSION_HEADER, VERSION_2024_04_15)
187194
.send(body)
188195
.expect(200)
189196
.then(async (response) => {
@@ -288,6 +295,7 @@ describe("Event types Endpoints", () => {
288295
it(`/GET/:id`, async () => {
289296
const response = await request(app.getHttpServer())
290297
.get(`/api/v2/event-types/${eventType.id}`)
298+
.set(CAL_API_VERSION_HEADER, VERSION_2024_04_15)
291299
// note: bearer token value mocked using "withApiAuth" for user which id is used when creating event type above
292300
.set("Authorization", `Bearer whatever`)
293301
.expect(200);
@@ -323,6 +331,7 @@ describe("Event types Endpoints", () => {
323331
it(`/GET/:username/public`, async () => {
324332
const response = await request(app.getHttpServer())
325333
.get(`/api/v2/event-types/${username}/public`)
334+
.set(CAL_API_VERSION_HEADER, VERSION_2024_04_15)
326335
// note: bearer token value mocked using "withApiAuth" for user which id is used when creating event type above
327336
.set("Authorization", `Bearer whatever`)
328337
.expect(200);
@@ -341,6 +350,7 @@ describe("Event types Endpoints", () => {
341350
it(`/GET/:username/:eventSlug/public`, async () => {
342351
const response = await request(app.getHttpServer())
343352
.get(`/api/v2/event-types/${username}/${eventType.slug}/public`)
353+
.set(CAL_API_VERSION_HEADER, VERSION_2024_04_15)
344354
// note: bearer token value mocked using "withApiAuth" for user which id is used when creating event type above
345355
.set("Authorization", `Bearer whatever`)
346356
.expect(200);
@@ -358,6 +368,7 @@ describe("Event types Endpoints", () => {
358368
it(`/GET/`, async () => {
359369
const response = await request(app.getHttpServer())
360370
.get(`/api/v2/event-types`)
371+
.set(CAL_API_VERSION_HEADER, VERSION_2024_04_15)
361372
// note: bearer token value mocked using "withApiAuth" for user which id is used when creating event type above
362373
.set("Authorization", `Bearer whatever`)
363374
.expect(200);
@@ -377,6 +388,7 @@ describe("Event types Endpoints", () => {
377388
it(`/GET/public/:username/`, async () => {
378389
const response = await request(app.getHttpServer())
379390
.get(`/api/v2/event-types/${username}/public`)
391+
.set(CAL_API_VERSION_HEADER, VERSION_2024_04_15)
380392
// note: bearer token value mocked using "withApiAuth" for user which id is used when creating event type above
381393
.set("Authorization", `Bearer whatever`)
382394
.expect(200);
@@ -393,13 +405,17 @@ describe("Event types Endpoints", () => {
393405
it(`/GET/:id not existing`, async () => {
394406
await request(app.getHttpServer())
395407
.get(`/api/v2/event-types/1000`)
408+
.set(CAL_API_VERSION_HEADER, VERSION_2024_04_15)
396409
// note: bearer token value mocked using "withApiAuth" for user which id is used when creating event type above
397410
.set("Authorization", `Bearer whatever`)
398411
.expect(404);
399412
});
400413

401414
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);
403419
});
404420

405421
afterAll(async () => {

0 commit comments

Comments
 (0)