mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +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:
commit
f2f2a91a29
1 changed files with 11 additions and 2 deletions
|
|
@ -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} />);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue