mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
test(api): align tests with new envelope codes
Update API handler tests to expect numeric `code`, `success` messages, and new envelope fields (`trace_id`, `details`), matching recent response envelope changes.
This commit is contained in:
@@ -500,14 +500,10 @@ func TestTrafficChart_MinuteGranularityValidation(t *testing.T) {
|
||||
t.Fatalf("expected status %d, got %d body=%s", tt.wantStatus, rr.Code, rr.Body.String())
|
||||
}
|
||||
|
||||
var resp map[string]any
|
||||
env := decodeEnvelope(t, rr, &resp)
|
||||
env := decodeEnvelope(t, rr, nil)
|
||||
if env.Message != tt.wantError {
|
||||
t.Fatalf("expected message=%q, got %q", tt.wantError, env.Message)
|
||||
}
|
||||
if errMsg, ok := resp["error"].(string); !ok || errMsg != tt.wantError {
|
||||
t.Fatalf("expected error=%q, got %v", tt.wantError, resp["error"])
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user