68c94dfa3a
* docs: define product and design direction * style: establish restrained workbench primitives * refactor: declutter board and task topbars * style: align dockview panel chrome * fix: align task topbar vcs control sizing * refactor: surface integrations navigation * fix: repair integrations and task creation workflow * refactor: include linear in integrations navigation * style: restore familiar workbench tones * fix: add dockview tab breathing room * fix: show configured integration shortcuts * fix: hover open integrations menu * fix: stabilize integrations hover menu * fix: align home and dockview topbars * fix: normalize home topbar controls * fix: compact home topbar height * fix: simplify home chrome and split buttons * fix: move integrations to left chrome * fix: restore home stats shortcut * fix: add dockview tab breathing room * fix: border home stats button * fix: streamline dockview topbar actions * fix: align task split button seam * fix: address review feedback * fix: restore topbar e2e affordances * fix: stabilize workflow e2e isolation * fix: add task topbar action overflow * fix: address PR review feedback
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { render, screen } from "@testing-library/react";
|
|
import { describe, expect, it, vi } from "vitest";
|
|
import { WorkflowSection } from "./task-create-dialog-form-body";
|
|
|
|
vi.mock("@/components/workflow-selector-row", () => ({
|
|
WorkflowSelectorRow: ({ selectedWorkflowId }: { selectedWorkflowId: string | null }) => (
|
|
<button type="button">Workflow selector {selectedWorkflowId ?? "none"}</button>
|
|
),
|
|
}));
|
|
|
|
const workflow = { id: "wf-1", name: "Development" };
|
|
|
|
function renderWorkflowSection(effectiveWorkflowId: string | null) {
|
|
return render(
|
|
<WorkflowSection
|
|
isCreateMode={true}
|
|
isTaskStarted={false}
|
|
workflows={[workflow]}
|
|
snapshots={{}}
|
|
effectiveWorkflowId={effectiveWorkflowId}
|
|
onWorkflowChange={() => {}}
|
|
agentProfiles={[]}
|
|
/>,
|
|
);
|
|
}
|
|
|
|
describe("WorkflowSection", () => {
|
|
it("keeps the selector reachable when no effective workflow is selected", () => {
|
|
renderWorkflowSection(null);
|
|
|
|
expect(screen.getByRole("button", { name: /workflow selector none/i })).toBeTruthy();
|
|
});
|
|
|
|
it("does not show redundant selector for a selected single workflow without overrides", () => {
|
|
const { container } = renderWorkflowSection("wf-1");
|
|
|
|
expect(container.textContent).toBe("");
|
|
});
|
|
});
|