MCPcopy Create free account
hub / github.com/driangle/taskmd / TestBuildAddedTaskMessage

Function TestBuildAddedTaskMessage

apps/cli/internal/cli/commit_msg_test.go:866–905  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

864}
865
866func TestBuildAddedTaskMessage(t *testing.T) {
867 tests := []struct {
868 name string
869 taskIDs []string
870 commitType string
871 want string
872 }{
873 {
874 name: "single task",
875 taskIDs: []string{"045"},
876 commitType: "chore",
877 want: "chore: added task 045\n",
878 },
879 {
880 name: "multiple tasks",
881 taskIDs: []string{"045", "046"},
882 commitType: "chore",
883 want: "chore: added tasks 045, 046\n",
884 },
885 {
886 name: "custom type",
887 taskIDs: []string{"045"},
888 commitType: "feat",
889 want: "feat: added task 045\n",
890 },
891 }
892
893 for _, tt := range tests {
894 t.Run(tt.name, func(t *testing.T) {
895 var tasks []*model.Task
896 for _, id := range tt.taskIDs {
897 tasks = append(tasks, &model.Task{ID: id})
898 }
899 got := buildAddedTaskMessage(tasks, tt.commitType)
900 if got != tt.want {
901 t.Errorf("buildAddedTaskMessage() = %q, want %q", got, tt.want)
902 }
903 })
904 }
905}
906
907// Tests for mixed change type detection
908

Callers

nothing calls this directly

Calls 1

buildAddedTaskMessageFunction · 0.85

Tested by

no test coverage detected