domainclaim: complete JSON schema validation - add created_by to fixture
Add CreatedBy to TestGetRoundTripsAndKeyShape fixture so all seven frozen
tags {schema, host, account, app, route, created_at, created_by} are
validated by the raw-bytes assertion, catching any struct tag rename
including the previously-unchecked created_by field.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 file changed,
+3
−3
internal/domainclaim/domainclaim_test.go+3 −3
diff --git a/internal/domainclaim/domainclaim_test.go b/internal/domainclaim/domainclaim_test.go| index 37f404cbe..2449e0bf0 100644 |
| --- a/internal/domainclaim/domainclaim_test.go |
| +++ b/internal/domainclaim/domainclaim_test.go |
| @@ -31,7 +31,7 @@ func TestGetRoundTripsAndKeyShape(t *testing.T) { |
| } |
| s := release.NewDirStore(t.TempDir()) |
| ctx := context.Background() |
| - in := Claim{Schema: 1, Host: "example.com", Account: "bdj", App: "story", Route: "story.bdj.oncarlos.com", CreatedAt: time.Unix(1755000000, 0).UTC()} |
| + in := Claim{Schema: 1, Host: "example.com", Account: "bdj", App: "story", Route: "story.bdj.oncarlos.com", CreatedAt: time.Unix(1755000000, 0).UTC(), CreatedBy: "cli:paul@keymail.dev"} |
| if err := Create(ctx, s, in); err != nil { |
| t.Fatal(err) |
| } |
| @@ -44,7 +44,7 @@ func TestGetRoundTripsAndKeyShape(t *testing.T) { |
| } |
| // Verify JSON schema: assert that the on-disk bytes have exactly the expected keys |
| - // to catch typos in struct tags (e.g. "account" → "accnt"). |
| + // to catch typos in struct tags (e.g. "account" → "accnt" or "created_by" → "createdby"). |
| rawBody, _, err := s.Get(ctx, Key("example.com")) |
| if err != nil { |
| t.Fatalf("raw Get: %v", err) |
| @@ -58,7 +58,7 @@ func TestGetRoundTripsAndKeyShape(t *testing.T) { |
| gotKeys = append(gotKeys, k) |
| } |
| sort.Strings(gotKeys) |
| - wantKeys := []string{"account", "app", "created_at", "host", "route", "schema"} |
| + wantKeys := []string{"account", "app", "created_at", "created_by", "host", "route", "schema"} |
| if !equal(gotKeys, wantKeys) { |
| t.Fatalf("JSON keys: got %v, want %v", gotKeys, wantKeys) |
| } |