mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-08 16:22:07 +00:00
Merge pull request #25480 from BerriAI/litellm_/eloquent-allen
[Fix] Flush Tremor Tooltip timers in user_edit_view tests
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { screen, waitFor } from "@testing-library/react";
|
||||
import { cleanup, screen, waitFor } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { renderWithProviders } from "../../tests/test-utils";
|
||||
import { UserEditView } from "./user_edit_view";
|
||||
|
||||
@@ -140,6 +140,15 @@ describe("UserEditView", () => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
// Tremor's internal Tooltip sets a setTimeout that fires after teardown,
|
||||
// causing "window is not defined". Flush pending timers before cleanup.
|
||||
vi.useFakeTimers();
|
||||
vi.runAllTimers();
|
||||
vi.useRealTimers();
|
||||
cleanup();
|
||||
});
|
||||
|
||||
it("should render", async () => {
|
||||
renderWithProviders(<UserEditView {...defaultProps} />);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user