Skip to content

Commit

Permalink
Properly fix #1744
Browse files Browse the repository at this point in the history
  • Loading branch information
svanharmelen committed Feb 3, 2024
1 parent def3c90 commit cd61482
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion testdata/list_todos.json
Expand Up @@ -11,7 +11,7 @@
"id": 2,
"state": "pending",
"target": {
"id": 2,
"id": "1d76d1b2e3e886108f662765c97f4687f4134d8c",
"approvals_before_merge": null
}
}
Expand Down
4 changes: 2 additions & 2 deletions todos.go
Expand Up @@ -58,8 +58,8 @@ type TodoTarget struct {
CreatedAt *time.Time `json:"created_at"`
Description string `json:"description"`
Downvotes int `json:"downvotes"`
ID int `json:"id"`
IID interface{} `json:"iid"`
ID interface{} `json:"id"`
IID int `json:"iid"`
Labels []string `json:"labels"`
Milestone *Milestone `json:"milestone"`
ProjectID int `json:"project_id"`
Expand Down
5 changes: 4 additions & 1 deletion todos_test.go
Expand Up @@ -36,7 +36,10 @@ func TestListTodos(t *testing.T) {

require.NoError(t, err)

want := []*Todo{{ID: 1, State: "pending", Target: &TodoTarget{ID: 1, ApprovalsBeforeMerge: 2}}, {ID: 2, State: "pending", Target: &TodoTarget{ID: 2}}}
want := []*Todo{
{ID: 1, State: "pending", Target: &TodoTarget{ID: float64(1), ApprovalsBeforeMerge: 2}},
{ID: 2, State: "pending", Target: &TodoTarget{ID: "1d76d1b2e3e886108f662765c97f4687f4134d8c"}},
}
require.Equal(t, want, todos)
}

Expand Down

0 comments on commit cd61482

Please sign in to comment.