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

Function createState

tests/unit/modals/taskEditChangeState.test.ts:26–57  ·  view source on GitHub ↗
(
	overrides: Partial<TaskEditModalChangeState> = {}
)

Source from the content-addressed store, hash-verified

24}
25
26function createState(
27 overrides: Partial<TaskEditModalChangeState> = {}
28): TaskEditModalChangeState {
29 const task = overrides.task ?? createTask();
30
31 return {
32 task,
33 title: task.title,
34 dueDate: task.due || "",
35 scheduledDate: task.scheduled || "",
36 priority: task.priority,
37 status: task.status,
38 contexts: (task.contexts || []).join(", "),
39 projects: (task.projects || []).join(", "),
40 tags: (task.tags || []).join(", "),
41 initialTags: (task.tags || []).join(", "),
42 timeEstimate: task.timeEstimate || 0,
43 recurrenceRule: typeof task.recurrence === "string" ? task.recurrence : "",
44 recurrenceAnchor: task.recurrence_anchor || "scheduled",
45 reminders: task.reminders || [],
46 blockedByItems: [],
47 initialBlockedBy: task.blockedBy || [],
48 blockingItems: [],
49 initialBlockingPaths: task.blocking || [],
50 details: task.details || "",
51 originalDetails: task.details || "",
52 completedInstancesChanges: [],
53 skippedInstancesChanges: [],
54 userFields: {},
55 ...overrides,
56 };
57}
58
59describe("taskEditChangeState", () => {
60 beforeEach(() => {

Callers 1

Calls 1

createTaskFunction · 0.70

Tested by

no test coverage detected