Skip to content

Commit 5dd3911

Browse files
committed
test(spec): assert the scope pin on the refused KEY LIST, not on a stringified issue
Measured during the ablation that falsifies it: with a ceiling planted on the gantt config there is no `unrecognized_keys` issue to stringify, so the case reddened with an argument-type complaint instead of a sentence about gantt. Claude-Session: https://claude.ai/code/session_01JbZnqu8bt6YqfJsr9vaFb3 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 16b54be commit 5dd3911

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎packages/spec/src/ui/view.test.ts‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4765,9 +4765,15 @@ describe('view row ceiling — `limit` on the page-shaped view configs (#17393)'
47654765
for (const [label, schema] of NON_GRID_FOUR) {
47664766
const result = schema.safeParse({ limit: 10 });
47674767
expect(result.success, label).toBe(false);
4768-
const unrecognized = ((result as { error?: z.ZodError }).error?.issues ?? [])
4769-
.find((issue) => issue.code === 'unrecognized_keys');
4770-
expect(JSON.stringify(unrecognized), label).toContain('limit');
4768+
// Asserted on the REFUSED KEY LIST rather than on a stringified issue:
4769+
// when the key is accepted there is no issue to stringify, and the red
4770+
// then reads as an argument-type complaint instead of as a statement
4771+
// about this view type. Measured — it is how this case first reddened.
4772+
const refused = ((result as { error?: z.ZodError }).error?.issues ?? [])
4773+
.filter((issue) => issue.code === 'unrecognized_keys')
4774+
.flatMap((issue) => (issue as unknown as { keys?: string[] }).keys ?? []);
4775+
expect(refused, `${label} accepts an authorable row ceiling it should not declare`)
4776+
.toContain('limit');
47714777
}
47724778
});
47734779
});

0 commit comments

Comments
 (0)