Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.

Commit cd61482

Browse files
committed
Properly fix #1744
1 parent def3c90 commit cd61482

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

testdata/list_todos.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"id": 2,
1212
"state": "pending",
1313
"target": {
14-
"id": 2,
14+
"id": "1d76d1b2e3e886108f662765c97f4687f4134d8c",
1515
"approvals_before_merge": null
1616
}
1717
}

todos.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ type TodoTarget struct {
5858
CreatedAt *time.Time `json:"created_at"`
5959
Description string `json:"description"`
6060
Downvotes int `json:"downvotes"`
61-
ID int `json:"id"`
62-
IID interface{} `json:"iid"`
61+
ID interface{} `json:"id"`
62+
IID int `json:"iid"`
6363
Labels []string `json:"labels"`
6464
Milestone *Milestone `json:"milestone"`
6565
ProjectID int `json:"project_id"`

todos_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ func TestListTodos(t *testing.T) {
3636

3737
require.NoError(t, err)
3838

39-
want := []*Todo{{ID: 1, State: "pending", Target: &TodoTarget{ID: 1, ApprovalsBeforeMerge: 2}}, {ID: 2, State: "pending", Target: &TodoTarget{ID: 2}}}
39+
want := []*Todo{
40+
{ID: 1, State: "pending", Target: &TodoTarget{ID: float64(1), ApprovalsBeforeMerge: 2}},
41+
{ID: 2, State: "pending", Target: &TodoTarget{ID: "1d76d1b2e3e886108f662765c97f4687f4134d8c"}},
42+
}
4043
require.Equal(t, want, todos)
4144
}
4245

0 commit comments

Comments
 (0)