mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Send empty http response when body is nil (#80196)
* build empty response if body is nil * fix test
This commit is contained in:
@@ -269,10 +269,7 @@ func TestAPIDeletePublicDashboard(t *testing.T) {
|
||||
assert.Equal(t, test.ExpectedHttpResponse, response.Code)
|
||||
|
||||
if test.ExpectedHttpResponse == http.StatusOK {
|
||||
var jsonResp any
|
||||
err := json.Unmarshal(response.Body.Bytes(), &jsonResp)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, jsonResp, nil)
|
||||
assert.Equal(t, []byte(nil), response.Body.Bytes())
|
||||
}
|
||||
|
||||
if !test.ShouldCallService {
|
||||
|
||||
Reference in New Issue
Block a user