fix: no available users found (recurring events) (#22033)

* only check first slot

* skip test for second slot availability check

* fixing tests in handleNewRecurringBooking.test.ts

* skip test

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
This commit is contained in:
Carina Wollendorfer
2025-06-27 09:31:56 +00:00
committed by GitHub
co-authored by CarinaWolli Hariom Balhara
parent e7c219905f
commit c4941f25a2
3 changed files with 11 additions and 11 deletions
@@ -23,7 +23,6 @@ import { v4 as uuidv4 } from "uuid";
import { describe, expect } from "vitest";
import { WEBAPP_URL, WEBSITE_URL } from "@calcom/lib/constants";
import { ErrorCode } from "@calcom/lib/errorCodes";
import logger from "@calcom/lib/logger";
import { BookingStatus, SchedulingType } from "@calcom/prisma/enums";
import { test } from "@calcom/web/test/fixtures/fixtures";
@@ -256,7 +255,7 @@ describe("handleNewRecurringBooking", () => {
timeout
);
test(
test.skip(
`should fail recurring booking if second slot is already booked`,
async ({}) => {
const booker = getBooker({
@@ -372,11 +371,12 @@ describe("handleNewRecurringBooking", () => {
};
});
await expect(() =>
handleNewRecurringBooking({
bookingData: bookingDataArray,
userId: -1,
})
await expect(
async () =>
await handleNewRecurringBooking({
bookingData: bookingDataArray,
userId: -1,
})
).rejects.toThrow(ErrorCode.NoAvailableUsersFound);
},
timeout
@@ -384,7 +384,7 @@ describe("handleNewRecurringBooking", () => {
});
describe("Round robin event type:", () => {
test("should fail recurring booking if a fixed host is not available on the second slot", async () => {
test.skip("should fail recurring booking if a fixed host is not available on the second slot", async () => {
const booker = getBooker({
email: "booker@example.com",
name: "Booker",
@@ -256,7 +256,7 @@ describe("handleNewBooking", () => {
timeout
);
test(
test.skip(
`should fail recurring booking if second slot is already booked`,
async ({}) => {
const handleRecurringEventBooking = (await import("@calcom/web/pages/api/book/recurring-event"))
@@ -822,7 +822,7 @@ describe("handleNewBooking", () => {
);
});
describe("Round robin event type:", () => {
test("should when when a fixed host is not available on the second slot", async () => {
test.skip("should when when a fixed host is not available on the second slot", async () => {
const handleRecurringEventBooking = (await import("@calcom/web/pages/api/book/recurring-event"))
.handleRecurringEventBooking;
const booker = getBooker({
@@ -29,7 +29,7 @@ export const handleNewRecurringBooking = async (input: BookingHandlerInput): Pro
});
const appsStatus: AppsStatus[] | undefined = undefined;
const numSlotsToCheckForAvailability = 2;
const numSlotsToCheckForAvailability = 1;
let thirdPartyRecurringEventId = null;