MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / createPlugin

Function createPlugin

tests/unit/ui/taskCardPrimaryIndicators.test.ts:23–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23function createPlugin(): TaskNotesPlugin {
24 return {
25 fieldMapper: {
26 isPropertyForField: jest.fn(
27 (propertyId: string, field: string) => propertyId === field
28 ),
29 },
30 statusManager: {
31 getStatusConfig: jest.fn((status: string) => {
32 if (status === "open") {
33 return { value: "open", label: "Open", color: "#111111" };
34 }
35 if (status === "done") {
36 return { value: "done", label: "Done", color: "#222222", icon: "check" };
37 }
38 return null;
39 }),
40 getNextStatus: jest.fn((status: string) => (status === "open" ? "done" : "open")),
41 },
42 priorityManager: {
43 getPriorityConfig: jest.fn((priority: string) => {
44 if (priority === "high") {
45 return { value: "high", label: "High", color: "#ff0000", icon: "flame" };
46 }
47 if (priority === "normal") {
48 return { value: "normal", label: "Normal", color: "#888888" };
49 }
50 return null;
51 }),
52 },
53 i18n: {
54 translate: jest.fn((key: string, vars?: Record<string, string>) => {
55 if (key === "ui.taskCard.priorityAriaLabel") {
56 return `Priority: ${vars?.label ?? ""}`;
57 }
58 return key;
59 }),
60 },
61 } as unknown as TaskNotesPlugin;
62}
63
64function createCard() {
65 const card = document.createElement("div");

Calls

no outgoing calls

Tested by

no test coverage detected