MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestCmdAddTaskWithDueDate

Function TestCmdAddTaskWithDueDate

internal/app/add_test.go:261–278  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

259}
260
261func TestCmdAddTaskWithDueDate(t *testing.T) {
262 setupFlowRoot(t)
263 if rc := cmdAdd([]string{"task", "Due Task", "--due", "2026-06-01"}); rc != 0 {
264 t.Fatalf("rc=%d", rc)
265 }
266 db := openFlowDB(t)
267 task, err := flowdb.GetTask(db, "due-task")
268 if err != nil {
269 t.Fatal(err)
270 }
271 if !task.DueDate.Valid || task.DueDate.String != "2026-06-01" {
272 t.Errorf("due_date: got %+v, want 2026-06-01", task.DueDate)
273 }
274 // status_changed_at should also be set.
275 if !task.StatusChangedAt.Valid || task.StatusChangedAt.String == "" {
276 t.Errorf("status_changed_at not set on new task: %+v", task.StatusChangedAt)
277 }
278}
279
280func TestCmdAddTaskWithBadDueDate(t *testing.T) {
281 setupFlowRoot(t)

Callers

nothing calls this directly

Calls 4

GetTaskFunction · 0.92
setupFlowRootFunction · 0.85
cmdAddFunction · 0.85
openFlowDBFunction · 0.85

Tested by

no test coverage detected