fix(02-03): treat null foreign keys as valid masked ids
PHP album payloads leave discogs_id null. The id mask required an integer and failed PHP self-replay on otherwise identical bodies. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,6 +16,10 @@ func TestNormalizeDateIDAndDisable(t *testing.T) {
|
||||
if diffs := compareBodies(Response{Headers: jsonCT(), Body: Body(want)}, Response{Headers: jsonCT(), Body: Body(gotOK)}, step); len(diffs) != 0 {
|
||||
t.Fatalf("masked date/id should pass: %+v", diffs)
|
||||
}
|
||||
nullID := []byte(`{"id":1,"discogs_id":null,"created_at":"2026-01-01T00:00:00+00:00","slug":"keep-me"}`)
|
||||
if diffs := compareBodies(Response{Headers: jsonCT(), Body: Body(nullID)}, Response{Headers: jsonCT(), Body: Body(nullID)}, step); len(diffs) != 0 {
|
||||
t.Fatalf("null *_id must pass: %+v", diffs)
|
||||
}
|
||||
zdiffs := compareBodies(Response{Headers: jsonCT(), Body: Body(want)}, Response{Headers: jsonCT(), Body: Body(gotZ)}, step)
|
||||
if len(zdiffs) == 0 {
|
||||
t.Fatal("Z date must fail")
|
||||
|
||||
Reference in New Issue
Block a user