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

@@ -73,8 +73,8 @@ func TestLogWebhookConfigCRUD(t *testing.T) {
var got service.LogWebhookConfig
env := decodeEnvelope(t, getRR, &got)
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 !got.Enabled || got.URL == "" || got.Threshold != 3 {
t.Fatalf("unexpected webhook config: %+v", got)