diff --git a/packages/dashboard/app/__tests__/research-modal-archive-lane-resolved.test.tsx b/packages/dashboard/app/__tests__/research-modal-archive-lane-resolved.test.tsx new file mode 100644 index 0000000000..a33aa02050 --- /dev/null +++ b/packages/dashboard/app/__tests__/research-modal-archive-lane-resolved.test.tsx @@ -0,0 +1,109 @@ +/* +FNXC:WorkflowResolvedColumns 2026-07-31-11:55 (u12 — the last convertible census guard in this file): +The enrich-mode task picker filtered archived rows with `task.column !== "archived"`. On a board whose +archive lane is renamed, that matched nothing, so filed-away tasks stayed in the picker and an operator +could attach research findings to work they had deliberately archived. + +Asserted as the INVARIANT rather than the single repro, per the surface-enumeration rule: a renamed +archive lane, the legacy id, an unresolved workflow (fail-soft), and a second workflow's archive lane +in the cross-workflow union. A repro-only test here would pass on the legacy board and prove nothing +about the case the guard exists for. +*/ +import { describe, it, expect, vi, beforeEach } from "vitest"; +import { render, waitFor } from "@testing-library/react"; +import type { Task } from "@fusion/core"; + +import { ResearchTaskActionModal } from "../components/ResearchTaskActionModal"; +import { fetchTasks } from "../api"; +import { useBoardWorkflows } from "../hooks/useBoardWorkflows"; + +vi.mock("../api", () => ({ fetchTasks: vi.fn() })); +vi.mock("../hooks/useBoardWorkflows", () => ({ useBoardWorkflows: vi.fn() })); +vi.mock("../hooks/useMobileScrollLock", () => ({ useMobileScrollLock: vi.fn() })); +vi.mock("react-i18next", () => ({ + useTranslation: () => ({ t: (_key: string, fallback?: string) => fallback ?? _key }), +})); + +const task = (id: string, column: string): Task => ({ + id, title: `task ${id}`, description: "", column, + dependencies: [], steps: [], currentStep: 0, log: [], + createdAt: "2026-01-01T00:00:00Z", updatedAt: "2026-01-01T00:00:00Z", +} as unknown as Task); + +function workflows(columns: { id: string; flags: Record }[][]) { + return { + boardWorkflows: { + defaultWorkflowId: "wf0", + workflows: columns.map((cols, i) => ({ id: `wf${i}`, name: `wf${i}`, columns: cols })), + }, + }; +} + +/* +The kept tasks render into a , whose