diff --git a/packages/dashboard/app/components/__tests__/SettingsModal.test.tsx b/packages/dashboard/app/components/__tests__/SettingsModal.test.tsx index 9e790fb82f..22fb24f2e7 100644 --- a/packages/dashboard/app/components/__tests__/SettingsModal.test.tsx +++ b/packages/dashboard/app/components/__tests__/SettingsModal.test.tsx @@ -1,6 +1,6 @@ import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; import type { ComponentProps } from "react"; -import { render, screen, fireEvent, waitFor, within, act } from "@testing-library/react"; +import { render, screen, fireEvent, waitFor, within, act, cleanup } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { EditorView } from "@codemirror/view"; import { SettingsModal } from "../SettingsModal"; @@ -517,7 +517,10 @@ describe("SettingsModal", () => { beforeEach(() => { + vi.useRealTimers(); vi.clearAllMocks(); + localStorage.clear(); + sessionStorage.clear(); clearPluginUiSlotsCache(); mockUseMobileKeyboard.mockReturnValue({ keyboardOpen: false, @@ -762,6 +765,12 @@ describe("SettingsModal", () => { }); afterEach(() => { + cleanup(); + clearPluginUiSlotsCache(); + localStorage.clear(); + sessionStorage.clear(); + vi.useRealTimers(); + vi.unstubAllGlobals(); vi.restoreAllMocks(); });