feat(FN-3056): merge fusion/fn-3056

This merge ships several feature and infrastructure improvements across the codebase. Task title validation is strengthened in triage with stricter rejection of malformed titles and preference for prompt-declared titles (FN-3056), while task creation now preserves priority settings (FN-3210). The Mi

Fusion-Task-Id: FN-3056
This commit is contained in:
Fusion
2026-05-02 11:37:15 -07:00
committed by gsxdsm
parent 9c45d2410b
commit 6b4f28a1fb
11 changed files with 205 additions and 11 deletions

View File

@@ -1281,6 +1281,52 @@ describe("POST /tasks", () => {
expect(store.createTask).not.toHaveBeenCalled();
});
it("forwards priority when provided", async () => {
const createdTask = {
...FAKE_TASK_DETAIL,
column: "triage",
priority: "high" as const,
};
(store.createTask as ReturnType<typeof vi.fn>).mockResolvedValue(createdTask);
const res = await REQUEST(
buildApp(),
"POST",
"/api/tasks",
JSON.stringify({
description: "Priority task",
priority: "high",
}),
{ "Content-Type": "application/json" },
);
expect(res.status).toBe(201);
expect(store.createTask).toHaveBeenCalledWith(
expect.objectContaining({
description: "Priority task",
priority: "high",
}),
expect.any(Object),
);
});
it("returns 400 for invalid priority value", async () => {
const res = await REQUEST(
buildApp(),
"POST",
"/api/tasks",
JSON.stringify({
description: "Bad priority",
priority: "medium",
}),
{ "Content-Type": "application/json" },
);
expect(res.status).toBe(400);
expect(res.body.error).toContain("priority must be one of");
expect(store.createTask).not.toHaveBeenCalled();
});
it("forwards executionMode when provided with 'fast'", async () => {
const createdTask = {
...FAKE_TASK_DETAIL,