feat(FN-3963): clarify automation tracked-task creation semantics

Adds regression tests for automation tracked-task creation behavior across the dashboard automation and tasks routes, plus a documentation clarification on the semantics of how automation creates tracked tasks.

Fusion-Task-Id: FN-3963
This commit is contained in:
Fusion
2026-05-10 19:36:55 -07:00
committed by gsxdsm
parent 87772e1fb5
commit 0c5c47933a
4 changed files with 265 additions and 1 deletions

View File

@@ -94,6 +94,22 @@ describe("maybeCreateTrackingIssue", () => {
expect(result).toEqual({ created: false, reason: "tracking_disabled" });
});
it("returns issue_already_linked and does not create again", async () => {
const result = await maybeCreateTrackingIssue(buildTask({
githubTracking: {
enabled: true,
issue: { owner: "task", repo: "repo", number: 99, url: "https://github.com/task/repo/issues/99" },
},
}), {
taskStore: {} as any,
projectSettings: { githubTrackingDefaultRepo: "task/repo", githubAuthMode: "token", githubAuthToken: "tok" } as any,
globalSettings: {},
});
expect(result).toEqual({ created: false, reason: "issue_already_linked" });
expect(createIssueMock).not.toHaveBeenCalled();
});
it("returns no_repo_configured and records activity", async () => {
const recordActivity = vi.fn();
const result = await maybeCreateTrackingIssue(buildTask({ githubTracking: { enabled: true } }), {