fix(FN-1102): persist workflow step selection in task create payloads

- Add browser verification toggle state to InlineCreateCard and submit browser-verification via enabledWorkflowSteps when selected
- Reset browser verification state after submit/cancel flows to prevent stale workflow selections
- Add InlineCreateCard and NewTaskModal tests that verify enabledWorkflowSteps are included in create payloads
- Add a patch changeset for @gsxdsm/fusion describing the workflow-step visibility fix
This commit is contained in:
gsxdsm
2026-04-07 23:26:28 -07:00
parent ed84a728c2
commit f0637af40c
4 changed files with 70 additions and 1 deletions

View File

@@ -350,6 +350,33 @@ describe("NewTaskModal", () => {
// Workflow step ordering tests (FN-836)
describe("workflow step ordering", () => {
it("sends selected enabledWorkflowSteps in create payload", async () => {
const { fetchWorkflowSteps } = await import("../../api");
vi.mocked(fetchWorkflowSteps).mockResolvedValueOnce([
{ id: "WS-001", name: "QA Check", description: "Run tests", prompt: "Check tests", enabled: true, createdAt: "", updatedAt: "" },
]);
const { props } = renderNewTaskModal();
await waitFor(() => {
expect(screen.getByTestId("workflow-step-checkbox-WS-001")).toBeTruthy();
});
const checkbox = screen.getByTestId("workflow-step-checkbox-WS-001").querySelector('input[type="checkbox"]') as HTMLInputElement;
fireEvent.click(checkbox);
fireEvent.change(screen.getByLabelText(/Description/i), { target: { value: "Task with workflow step" } });
fireEvent.click(screen.getByRole("button", { name: "Create Task" }));
await waitFor(() => {
expect(props.onCreateTask).toHaveBeenCalledWith(
expect.objectContaining({
enabledWorkflowSteps: ["WS-001"],
}),
);
});
});
it("sends ordered enabledWorkflowSteps in create payload when steps are selected in order", async () => {
const { fetchWorkflowSteps } = await import("../../api");
vi.mocked(fetchWorkflowSteps).mockResolvedValueOnce([