Skip to content

Commit 78a968f

Browse files
committed
fix: tests
1 parent 37cd7ba commit 78a968f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/user-bookings.e2e-spec.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
} from "@calcom/platform-constants";
3535
import {
3636
CreateEventTypeInput_2024_06_14,
37+
FAILED_EVENT_TYPE_IDENTIFICATION_ERROR_MESSAGE,
3738
GetBookingOutput_2024_08_13,
3839
GetBookingsOutput_2024_08_13,
3940
GetSeatedBookingOutput_2024_08_13,
@@ -1692,11 +1693,9 @@ describe("Bookings Endpoints 2024-08-13", () => {
16921693
.set(CAL_API_VERSION_HEADER, VERSION_2024_08_13)
16931694
.expect(400);
16941695

1695-
expect(
1696-
response.body.error.message.includes(
1697-
"Either eventTypeId OR (eventTypeSlug + username) must be provided"
1698-
)
1699-
).toBe(true);
1696+
expect(response.body.error.message.includes(FAILED_EVENT_TYPE_IDENTIFICATION_ERROR_MESSAGE)).toBe(
1697+
true
1698+
);
17001699
});
17011700

17021701
it("should create a booking by username and event type slug", async () => {

packages/platform/types/bookings/2024-08-13/inputs/create-booking.input.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ import {
3636
} from "./location.input";
3737
import { ValidateMetadata } from "./validators/validate-metadata";
3838

39+
export const FAILED_EVENT_TYPE_IDENTIFICATION_ERROR_MESSAGE =
40+
"Either eventTypeId or eventTypeSlug + username or eventTypeSlug + teamSlug must be provided";
41+
3942
function RequireEventTypeIdentification(validationOptions?: ValidationOptions) {
4043
return function (object: any) {
4144
registerDecorator({
@@ -57,7 +60,7 @@ function RequireEventTypeIdentification(validationOptions?: ValidationOptions) {
5760
return hasEventTypeId || hasSlugAndUsername || hasSlugAndTeamSlug;
5861
},
5962
defaultMessage(): string {
60-
return "Either eventTypeId or eventTypeSlug + username or eventTypeSlug + teamSlug must be provided";
63+
return FAILED_EVENT_TYPE_IDENTIFICATION_ERROR_MESSAGE;
6164
},
6265
},
6366
});

0 commit comments

Comments
 (0)