mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-14 01:37:52 +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:
@@ -58,8 +58,8 @@ func TestAdminHandler_GetAPIKeyStatsSummary(t *testing.T) {
|
||||
|
||||
var resp APIKeyStatsSummaryResponse
|
||||
env := decodeEnvelope(t, rec, &resp)
|
||||
if env.Code != "ok" {
|
||||
t.Fatalf("expected code=ok, got %q", env.Code)
|
||||
if env.Code != 0 {
|
||||
t.Fatalf("expected code=0, got %d", env.Code)
|
||||
}
|
||||
if resp.TotalRequests != 15 || resp.SuccessRequests != 12 || resp.FailureRequests != 3 {
|
||||
t.Fatalf("totals mismatch: %+v", resp)
|
||||
|
||||
Reference in New Issue
Block a user