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

Function TestCreateProjectsConfig_ViewsParsing

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

Source from the content-addressed store, hash-verified

230}
231
232func TestCreateProjectsConfig_ViewsParsing(t *testing.T) {
233 compiler := NewCompiler()
234
235 outputMap := map[string]any{
236 "create-project": map[string]any{
237 "max": 1,
238 "views": []any{
239 map[string]any{
240 "name": "Sprint Board",
241 "layout": "board",
242 "filter": "is:open label:sprint",
243 },
244 map[string]any{
245 "name": "Timeline",
246 "layout": "roadmap",
247 },
248 },
249 },
250 }
251
252 config := compiler.parseCreateProjectsConfig(outputMap)
253 require.NotNil(t, config)
254 require.Len(t, config.Views, 2, "Should parse 2 views")
255
256 // Check first view
257 assert.Equal(t, "Sprint Board", config.Views[0].Name)
258 assert.Equal(t, "board", config.Views[0].Layout)
259 assert.Equal(t, "is:open label:sprint", config.Views[0].Filter)
260
261 // Check second view
262 assert.Equal(t, "Timeline", config.Views[1].Name)
263 assert.Equal(t, "roadmap", config.Views[1].Layout)
264 assert.Empty(t, config.Views[1].Filter) // No filter specified
265}
266
267func TestCreateProjectsConfig_FieldDefinitionsParsing(t *testing.T) {
268 compiler := NewCompiler()

Callers

nothing calls this directly

Calls 2

NewCompilerFunction · 0.85

Tested by

no test coverage detected