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

Function TestCmdUpdateTaskAssignee

internal/app/update_test.go:246–266  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

244}
245
246func TestCmdUpdateTaskAssignee(t *testing.T) {
247 setupFlowRoot(t)
248 seedTask(t, "ut-assign")
249
250 if rc := cmdUpdate([]string{"task", "ut-assign", "--assignee", "alice"}); rc != 0 {
251 t.Fatalf("rc=%d", rc)
252 }
253 db := openFlowDB(t)
254 task, _ := flowdb.GetTask(db, "ut-assign")
255 if !task.Assignee.Valid || task.Assignee.String != "alice" {
256 t.Errorf("assignee = %+v, want alice", task.Assignee)
257 }
258
259 if rc := cmdUpdate([]string{"task", "ut-assign", "--clear-assignee"}); rc != 0 {
260 t.Fatalf("clear rc=%d", rc)
261 }
262 task, _ = flowdb.GetTask(db, "ut-assign")
263 if task.Assignee.Valid {
264 t.Errorf("assignee should be NULL after clear, got %q", task.Assignee.String)
265 }
266}
267
268func TestCmdUpdateTaskAssigneeMutuallyExclusive(t *testing.T) {
269 setupFlowRoot(t)

Callers

nothing calls this directly

Calls 5

GetTaskFunction · 0.92
setupFlowRootFunction · 0.85
seedTaskFunction · 0.85
cmdUpdateFunction · 0.85
openFlowDBFunction · 0.85

Tested by

no test coverage detected