Skip to content
Prev Previous commit
Next Next commit
Expand item-list field column test with more display types
Extend TestRunList_FieldColumn to exercise number, labels, and iteration
field values end-to-end alongside the existing single-select column,
per review suggestion.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ea543af9-2102-4a70-b011-652d2457ce07
  • Loading branch information
zwick and Copilot committed Jul 22, 2026
commit e73a64721b2ace867db02e8a188f55b9bbf933b9
53 changes: 50 additions & 3 deletions pkg/cmd/project/item-list/item_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,24 @@ func TestRunList_FieldColumn(t *testing.T) {
"name": "Status",
"dataType": "SINGLE_SELECT",
},
{
"__typename": "ProjectV2Field",
"id": "est ID",
"name": "Est",
"dataType": "NUMBER",
},
{
"__typename": "ProjectV2Field",
"id": "tags ID",
"name": "Tags",
"dataType": "LABELS",
},
{
"__typename": "ProjectV2IterationField",
"id": "iter ID",
"name": "Iter",
"dataType": "ITERATION",
},
},
},
"items": map[string]interface{}{
Expand All @@ -827,6 +845,35 @@ func TestRunList_FieldColumn(t *testing.T) {
"id": "status ID",
},
},
{
"__typename": "ProjectV2ItemFieldNumberValue",
"number": 5,
"field": map[string]interface{}{
"__typename": "ProjectV2Field",
"id": "est ID",
},
},
{
"__typename": "ProjectV2ItemFieldLabelValue",
"labels": map[string]interface{}{
"nodes": []map[string]interface{}{
{"name": "bug"},
{"name": "p1"},
},
},
"field": map[string]interface{}{
"__typename": "ProjectV2Field",
"id": "tags ID",
},
},
{
"__typename": "ProjectV2ItemFieldIterationValue",
"title": "S1",
"field": map[string]interface{}{
"__typename": "ProjectV2IterationField",
"id": "iter ID",
},
},
},
},
},
Expand All @@ -845,7 +892,7 @@ func TestRunList_FieldColumn(t *testing.T) {
opts: listOpts{
number: 1,
owner: "monalisa",
fields: []string{"Status"},
fields: []string{"Status", "Est", "Tags", "Iter"},
},
client: client,
io: ios,
Expand All @@ -854,8 +901,8 @@ func TestRunList_FieldColumn(t *testing.T) {
err := runList(config)
assert.NoError(t, err)
assert.Equal(t, heredoc.Doc(`
TYPE TITLE NUMBER REPOSITORY ID STATUS
Issue an issue 1 cli/go-gh issue ID In Progress
TYPE TITLE NUMBER REPOSITORY ID STATUS EST TAGS ITER
Issue an issue 1 cli/go-gh issue ID In Progress 5 bug, p1 S1
`), stdout.String())
}

Expand Down