From cb2509683de9bae1a736c0ceea76b73fdb24880a Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Fri, 12 Dec 2025 10:28:29 +0530 Subject: [PATCH] fix: unit test flake (#25780) --- .../Booker/components/hooks/useInitialFormValues.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/features/bookings/Booker/components/hooks/useInitialFormValues.test.ts b/packages/features/bookings/Booker/components/hooks/useInitialFormValues.test.ts index 14322d3487..f358cd603a 100644 --- a/packages/features/bookings/Booker/components/hooks/useInitialFormValues.test.ts +++ b/packages/features/bookings/Booker/components/hooks/useInitialFormValues.test.ts @@ -1,8 +1,8 @@ /** * @vitest-environment jsdom */ -import { renderHook, waitFor } from "@testing-library/react"; -import { describe, it, expect, vi, beforeEach } from "vitest"; +import { cleanup, renderHook, waitFor } from "@testing-library/react"; +import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; import type { BookerEvent } from "@calcom/features/bookings/types"; @@ -49,6 +49,10 @@ describe("useInitialFormValues - Autofill Disable Feature", () => { vi.clearAllMocks(); }); + afterEach(() => { + cleanup(); + }); + describe("when organization has NOT disabled autofill", () => { it("should use URL parameters to prefill form fields", async () => { const eventType: Pick = {