MCPcopy Create free account
hub / github.com/github/gh-aw / TestParseCreateProjectsConfig

Function TestParseCreateProjectsConfig

pkg/workflow/create_project_test.go:12–214  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestParseCreateProjectsConfig(t *testing.T) {
13 tests := []struct {
14 name string
15 outputMap map[string]any
16 expectedConfig *CreateProjectsConfig
17 expectedNil bool
18 }{
19 {
20 name: "basic config with max",
21 outputMap: map[string]any{
22 "create-project": map[string]any{
23 "max": 2,
24 },
25 },
26 expectedConfig: &CreateProjectsConfig{
27 BaseSafeOutputConfig: BaseSafeOutputConfig{
28 Max: strPtr("2"),
29 },
30 },
31 },
32 {
33 name: "config with all fields",
34 outputMap: map[string]any{
35 "create-project": map[string]any{
36 "max": 1,
37 "github-token": "${{ secrets.PROJECTS_PAT }}",
38 "target-owner": "myorg",
39 "title-prefix": "Project",
40 },
41 },
42 expectedConfig: &CreateProjectsConfig{
43 BaseSafeOutputConfig: BaseSafeOutputConfig{
44 Max: strPtr("1"),
45 },
46 GitHubToken: "${{ secrets.PROJECTS_PAT }}",
47 TargetOwner: "myorg",
48 TitlePrefix: "Project",
49 },
50 },
51 {
52 name: "config with views",
53 outputMap: map[string]any{
54 "create-project": map[string]any{
55 "max": 1,
56 "views": []any{
57 map[string]any{
58 "name": "Roadmap",
59 "layout": "roadmap",
60 "filter": "is:issue is:pr",
61 },
62 map[string]any{
63 "name": "Task Tracker",
64 "layout": "table",
65 "filter": "is:open",
66 },
67 },
68 },
69 },

Callers

nothing calls this directly

Calls 4

strPtrFunction · 0.85
NewCompilerFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected