Improve UI views for assets/components/failures and timeline details
This commit is contained in:
19
internal/api/ingest_decode_test.go
Normal file
19
internal/api/ingest_decode_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package api
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestDecodeJSONBytesIgnoresUnknownFields(t *testing.T) {
|
||||
payload := []byte(`{"known":"value","status_at_collection":"ok"}`)
|
||||
|
||||
var req struct {
|
||||
Known string `json:"known"`
|
||||
}
|
||||
|
||||
if err := decodeJSONBytes(payload, &req); err != nil {
|
||||
t.Fatalf("decode payload: %v", err)
|
||||
}
|
||||
if req.Known != "value" {
|
||||
t.Fatalf("expected known field to be decoded, got %q", req.Known)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user