From 7c2d3f5f7af35f10f830a68c70db44620910e58d Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Tue, 9 Jun 2026 03:46:44 -0700 Subject: [PATCH] FN-6036: restore SettingsModal workflow-lane test cleanup Restore the SettingsModal project models workflow-lane test setup so runs start from a clean browser state. - import and call testing-library cleanup after each test - reset timers, plugin UI slot cache, and browser storage in test hooks - unstub globals during teardown to prevent cross-test leakage Files changed: .../dashboard/app/components/__tests__/SettingsModal.test.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) Fusion-Task-Id: FN-6036 Fusion-Task-Lineage: 69976a8b-272f-43a4-b61e-538993f930c8 --- .../app/components/__tests__/SettingsModal.test.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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(); });