MCPcopy
hub / github.com/callumalpass/tasknotes / createPlugin

Function createPlugin

tests/unit/ui/taskCardContextMenu.test.ts:27–56  ·  view source on GitHub ↗
(task: TaskInfo | null = createTask())

Source from the content-addressed store, hash-verified

25}
26
27function createPlugin(task: TaskInfo | null = createTask()): TaskNotesPlugin {
28 return {
29 settings: {
30 enableDebugLogging: false,
31 },
32 i18n: {
33 translate: jest.fn((key: string) => {
34 if (key === "ui.taskCard.taskOptions") {
35 return "Task options";
36 }
37 return key;
38 }),
39 },
40 app: {
41 vault: {
42 getAbstractFileByPath: jest.fn(() => null),
43 },
44 workspace: {
45 trigger: jest.fn(),
46 getLeaf: jest.fn(() => ({
47 openFile: jest.fn(),
48 })),
49 openLinkText: jest.fn(),
50 },
51 },
52 cacheManager: {
53 getTaskInfo: jest.fn(async () => task),
54 },
55 } as unknown as TaskNotesPlugin;
56}
57
58describe("taskCardContextMenu", () => {
59 beforeEach(() => {

Callers 1

Calls 1

createTaskFunction · 0.70

Tested by

no test coverage detected