diff --git a/packages/dashboard/app/components/__tests__/useRightDockController.card-column-flags.test.tsx b/packages/dashboard/app/components/__tests__/useRightDockController.card-column-flags.test.tsx new file mode 100644 index 0000000000..4434e76033 --- /dev/null +++ b/packages/dashboard/app/components/__tests__/useRightDockController.card-column-flags.test.tsx @@ -0,0 +1,125 @@ +/* +FNXC:WorkflowResolvedColumns 2026-07-31-02:20: +THE DOCK'S `renderTaskCard` IS THE SECOND PRODUCER OF THIS AFFORDANCE, AND IT HAD NO TEST. + +#3025 fixed both producers of a dock/plugin-rendered `TaskCard` — `MainContent.renderTaskCard` and +this hook's — so that the card receives `taskColumnFlags` instead of resolving nothing and falling +back to legacy lane ids for every role helper inside it (archive/revert affordances, progress, the +elapsed-time indicator, the planning badge). + +Its test covered `MainContent` only. MEASURED: deleting +`taskColumnFlags={input.columnFlagsByTaskId?.get(task.id)}` from `useRightDockController` left the +whole suite green — `MainContent.graph-popout` 6/6, `RightDock` 33/33, `TaskCard.host-inventory` 1/1. +That PR's own revert-check note says dropping the prop "from either `renderTaskCard`" would show up; +for this producer it did not. + +So the pair could silently become a single again, on the producer that draws cards into the right +dock where an operator actually sees them. One affordance with two producers needs two assertions — +the Surface Enumeration rule applies to the coverage, not only to the fix. + +Driven through the hook's real `renderTaskCard`, captured off the `renderProps` the controller hands +`RightDock`: that function IS the contract this pins. `RightDock` itself is stubbed so the assertion +cannot fail for unrelated dock plumbing. +*/ + +import React from "react"; +import { describe, it, expect, vi } from "vitest"; +import { render } from "@testing-library/react"; +import type { Task } from "@fusion/core"; +import { useRightDockController } from "../useRightDockController"; + +/* Capture the renderProps the controller builds; `renderTaskCard` is not on the returned controller. */ +const captured: { renderTaskCard?: (task: Task) => React.ReactNode } = {}; +vi.mock("../RightDock", async (importOriginal) => ({ + /* Keep the module's real exports — the controller imports its persistence helpers from here, and a + bare factory silently drops them ("No readStoredRightDockOpen export is defined on the mock"). */ + ...(await importOriginal>()), + RightDock: ({ renderProps }: { renderProps: { renderTaskCard?: (task: Task) => React.ReactNode } }) => { + captured.renderTaskCard = renderProps?.renderTaskCard; + return