Repair TaskDetailModal tests so Definition-surface assertions remain valid after Chat became the default tab. - Add regression coverage for explicitly opening the Definition tab while the default tab remains Chat. - Set definition-focused TaskDetailModal test renders to use initialTab="definition" across the split dashboard lanes. - Document why Definition-only assertions opt into the Definition tab after the Chat-default-tab change. Files changed: .../TaskDetailModal.attachments-and-tabs.test.tsx | 33 +++++++++ ...TaskDetailModal.github-tracking-header.test.tsx | 5 ++ .../TaskDetailModal.github-tracking-stale.test.tsx | 11 +++ ...lModal.inline-editing-and-integrations.test.tsx | 83 ++++++++++++++++++++++ ...skDetailModal.models-progress-workflow.test.tsx | 33 +++++++++ .../__tests__/TaskDetailModal.rendering.test.tsx | 73 +++++++++++++++++++ ...etailModal.responsive-and-dependencies.test.tsx | 37 ++++++++++ .../components/__tests__/TaskDetailModal.test.tsx | 17 +++++ 8 files changed, 292 insertions(+) Fusion-Task-Id: FN-6574 Fusion-Task-Lineage: f8d5e038-058a-4d12-8384-2ef603988e3a
49 lines
2.2 KiB
TypeScript
49 lines
2.2 KiB
TypeScript
/*
|
|
FNXC:TaskDetailTabs 2026-06-17-08:20:
|
|
FN-6532 made Chat the default TaskDetailModal tab. Tests that assert Definition-only sections must opt into `initialTab="definition"` so they verify the intended surface instead of the Chat landing state.
|
|
*/
|
|
import { describe, expect, it } from "vitest";
|
|
import { render, screen } from "@testing-library/react";
|
|
import { loadAllAppCss } from "../../test/cssFixture";
|
|
import { TaskDetailModal } from "../TaskDetailModal";
|
|
import { makeTask, noop, noopDelete, noopMerge, noopMove, noopOpenDetail, setupTaskDetailModalHooks } from "./TaskDetailModal.test-helpers";
|
|
|
|
setupTaskDetailModalHooks();
|
|
|
|
describe("FN-4224 GitHub tracking header layout", () => {
|
|
it("keeps the summary, enable action, and disclosure toggle on one row across desktop and mobile CSS", () => {
|
|
render(
|
|
<TaskDetailModal
|
|
initialTab="definition"
|
|
task={makeTask({
|
|
column: "todo",
|
|
githubTracking: { enabled: false },
|
|
})}
|
|
onClose={noop}
|
|
onMoveTask={noopMove}
|
|
onDeleteTask={noopDelete}
|
|
onMergeTask={noopMerge}
|
|
onOpenDetail={noopOpenDetail}
|
|
addToast={noop}
|
|
/>,
|
|
);
|
|
|
|
expect(screen.getByText("GitHub tracking")).toBeInTheDocument();
|
|
expect(screen.getByText("Tracking is currently disabled")).toBeInTheDocument();
|
|
expect(screen.getByRole("button", { name: "Enable GitHub tracking" })).toHaveTextContent("Enable");
|
|
expect(screen.getByRole("button", { name: "Expand GitHub tracking details" })).toBeInTheDocument();
|
|
|
|
const css = loadAllAppCss();
|
|
|
|
expect(css).toMatch(
|
|
/\.detail-github-tracking-section\s+\.detail-source-header\s*\{[^}]*flex-wrap:\s*nowrap;[^}]*align-items:\s*center;[^}]*min-width:\s*0;/,
|
|
);
|
|
expect(css).toMatch(
|
|
/\.detail-github-tracking-section\s+\.detail-source-summary\s*\{[^}]*flex:\s*1 1 auto;[^}]*flex-wrap:\s*nowrap;[^}]*min-width:\s*0;/,
|
|
);
|
|
expect(css).toMatch(
|
|
/@media[^{]*\(max-width:\s*768px\)[^{]*\{[\s\S]*?\.detail-github-tracking-section\s+\.detail-source-header\s*\{[^}]*flex-wrap:\s*nowrap;[^}]*min-width:\s*0;[^}]*\}[\s\S]*?\.detail-github-tracking-section\s+\.detail-source-summary\s*\{[^}]*flex:\s*1 1 auto;[^}]*flex-wrap:\s*nowrap;[^}]*min-width:\s*0;[^}]*\}/,
|
|
);
|
|
});
|
|
});
|