Refactor integration test DecodeJSON calls to use generic return value (#37432)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -28,8 +28,7 @@ func TestHeatmapEndpoints(t *testing.T) {
|
||||
req := NewRequest(t, "GET", "/user2/-/heatmap")
|
||||
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
var result map[string]any
|
||||
DecodeJSON(t, resp, &result)
|
||||
result := DecodeJSON(t, resp, map[string]any{})
|
||||
assert.Contains(t, result, "heatmapData")
|
||||
assert.Contains(t, result, "totalContributions")
|
||||
assert.Positive(t, result["totalContributions"])
|
||||
@@ -40,8 +39,7 @@ func TestHeatmapEndpoints(t *testing.T) {
|
||||
req := NewRequest(t, "GET", "/org/org3/dashboard/-/heatmap")
|
||||
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
var result map[string]any
|
||||
DecodeJSON(t, resp, &result)
|
||||
result := DecodeJSON(t, resp, map[string]any{})
|
||||
assert.Contains(t, result, "heatmapData")
|
||||
assert.Contains(t, result, "totalContributions")
|
||||
})
|
||||
@@ -51,8 +49,7 @@ func TestHeatmapEndpoints(t *testing.T) {
|
||||
req := NewRequest(t, "GET", "/org/org3/dashboard/-/heatmap/team1")
|
||||
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
var result map[string]any
|
||||
DecodeJSON(t, resp, &result)
|
||||
result := DecodeJSON(t, resp, map[string]any{})
|
||||
assert.Contains(t, result, "heatmapData")
|
||||
assert.Contains(t, result, "totalContributions")
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user