kaneo (minimalist kanban) fork to experiment adding a tangled integration github.com/usekaneo/kaneo
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 9a620ba2f31238f03cd28f1da5ef3838d67e4e8a 37 lines 1.3 kB view raw
1import { describe, expect, it } from "vitest"; 2import { 3 formatIssueBody, 4 formatIssueTitle, 5 formatSyncComment, 6 formatTaskDescriptionFromIssue, 7 getLabelsForIssue, 8} from "../../../../../apps/api/src/plugins/github/utils/format"; 9 10describe("github format helpers", () => { 11 it("returns the title unchanged", () => { 12 expect(formatIssueTitle("Ship notifications")).toBe("Ship notifications"); 13 }); 14 15 it("formats issue bodies with and without a description", () => { 16 expect(formatIssueBody(null, "task_123")).toBe("<sub>Task: task_123</sub>"); 17 expect(formatIssueBody("Body text", "task_123")).toBe(`Body text 18 19--- 20<sub>Task: task_123</sub>`); 21 }); 22 23 it("formats sync comments and task descriptions", () => { 24 expect(formatSyncComment("task_123")).toBe("Task: task_123"); 25 expect(formatTaskDescriptionFromIssue("Issue body")).toBe("Issue body"); 26 expect(formatTaskDescriptionFromIssue(null)).toBe(""); 27 }); 28 29 it("builds labels while skipping no-priority", () => { 30 expect(getLabelsForIssue("high", "in-review")).toEqual([ 31 "priority:high", 32 "status:in-review", 33 ]); 34 expect(getLabelsForIssue("no-priority", "done")).toEqual(["status:done"]); 35 expect(getLabelsForIssue(null, "planned")).toEqual(["status:planned"]); 36 }); 37});