From 826ebfae1ccef7b84b7dea0135568fabeb40c9fc Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Sat, 11 Oct 2025 11:06:36 -0700 Subject: [PATCH] ui fix --- .../components/CreateTagModal.test.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ui/litellm-dashboard/src/components/tag_management/components/CreateTagModal.test.tsx b/ui/litellm-dashboard/src/components/tag_management/components/CreateTagModal.test.tsx index f073b6298c..073c97fec0 100644 --- a/ui/litellm-dashboard/src/components/tag_management/components/CreateTagModal.test.tsx +++ b/ui/litellm-dashboard/src/components/tag_management/components/CreateTagModal.test.tsx @@ -1,5 +1,5 @@ -import { describe, it, expect, vi, beforeEach, beforeAll } from "vitest"; -import { render, screen, waitFor } from "@testing-library/react"; +import { describe, it, expect, vi, beforeEach, beforeAll, afterEach } from "vitest"; +import { render, screen, waitFor, cleanup } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import CreateTagModal from "./CreateTagModal"; @@ -44,6 +44,13 @@ describe("CreateTagModal", () => { beforeEach(() => { vi.clearAllMocks(); + vi.useFakeTimers(); + }); + + afterEach(() => { + cleanup(); + vi.clearAllTimers(); + vi.useRealTimers(); }); it("should submit form with correct values when user creates a tag", async () => { @@ -91,6 +98,9 @@ describe("CreateTagModal", () => { // Verify onCancel was not called expect(mockOnCancel).not.toHaveBeenCalled(); + + // Clear any pending timers before test ends + vi.runOnlyPendingTimers(); }); });