MCPcopy Create free account
hub / github.com/Cawlumm/lyftr / TestCreateProgram_missingName

Function TestCreateProgram_missingName

backend/controllers/programs_test.go:80–94  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

78 t.Fatalf("expected 1 exercise, got %d", len(exercises))
79 }
80 ex0 := exercises[0].(map[string]any)
81 sets, ok := ex0["sets"].([]any)
82 if !ok {
83 t.Fatalf("sets field missing or wrong type: %T = %v", ex0["sets"], ex0["sets"])
84 }
85 if len(sets) != 3 {
86 t.Errorf("expected 3 sets, got %d", len(sets))
87 }
88}
89
90func TestCreateProgram_missingName(t *testing.T) {
91 setupTestDB(t)
92 uid := createTestUser(t)
93
94 body := map[string]any{
95 "name": "",
96 "days": []map[string]any{},
97 }

Callers

nothing calls this directly

Calls 4

setupTestDBFunction · 0.85
createTestUserFunction · 0.85
newContextFunction · 0.85
CreateProgramMethod · 0.80

Tested by

no test coverage detected