Skip to content

Commit

Permalink
add missing min/max to BoardConfigurationColumn (#430)
Browse files Browse the repository at this point in the history
* feat: add missing min/max fields to BoardConfigurationColumn

* fix: add omitempty to min/max in BoardConfigurationColumn
  • Loading branch information
brenol committed Dec 30, 2021
1 parent 8a363be commit f558a51
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions board.go
Expand Up @@ -117,6 +117,8 @@ type BoardConfigurationColumnConfig struct {
type BoardConfigurationColumn struct {
Name string `json:"name"`
Status []BoardConfigurationColumnStatus `json:"statuses"`
Min int `json:"min,omitempty"`
Max int `json:"max,omitempty"`
}

// BoardConfigurationColumnStatus represents a status in the column configuration
Expand Down
15 changes: 15 additions & 0 deletions board_test.go
Expand Up @@ -248,4 +248,19 @@ func TestBoardService_GetBoardConfigoration(t *testing.T) {
t.Errorf("Expected 6 columns. go %d", len(boardConfiguration.ColumnConfig.Columns))
}

backlogColumn := boardConfiguration.ColumnConfig.Columns[0]
if backlogColumn.Min != 5 {
t.Errorf("Expected a min of 5 issues in backlog. Got %d", backlogColumn.Min)
}
if backlogColumn.Max != 30 {
t.Errorf("Expected a max of 30 issues in backlog. Got %d", backlogColumn.Max)
}

inProgressColumn := boardConfiguration.ColumnConfig.Columns[2]
if inProgressColumn.Min != 0 {
t.Errorf("Expected a min of 0 issues in progress. Got %d", inProgressColumn.Min)
}
if inProgressColumn.Max != 0 {
t.Errorf("Expected a max of 0 issues in progress. Got %d", inProgressColumn.Max)
}
}
4 changes: 3 additions & 1 deletion mocks/board_configuration.json
Expand Up @@ -26,7 +26,9 @@
"id": "10005",
"self": "https://test.jira.org/rest/api/2/status/10005"
}
]
],
"min": 5,
"max": 30
},
{
"name": "Selected for development",
Expand Down

0 comments on commit f558a51

Please sign in to comment.