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:
zenfun
2026-01-10 00:39:35 +08:00
parent cb3b7e8230
commit dd32ee817d
7 changed files with 29 additions and 35 deletions

View File

@@ -7,9 +7,11 @@ import (
)
type testEnvelope struct {
Code string `json:"code"`
Code int `json:"code"`
Data json.RawMessage `json:"data"`
Message string `json:"message"`
TraceID string `json:"trace_id"`
Details any `json:"details,omitempty"`
}
func decodeEnvelope(t *testing.T, rr *httptest.ResponseRecorder, out any) testEnvelope {