(t *testing.T)
| 230 | } |
| 231 | |
| 232 | func 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 | |
| 267 | func TestCreateProjectsConfig_FieldDefinitionsParsing(t *testing.T) { |
| 268 | compiler := NewCompiler() |
nothing calls this directly
no test coverage detected