Skip to content

Commit fa6ee04

Browse files
os-billclaude
andcommitted
test(spec): select the pageName tombstone issue by its shape, not by its text
The #17063 overlay-door pin found its issue with `message.includes(...)`. Since the prescription is now lifted onto the union wrapper too, that find is satisfied by either the wrapper (path []) or the tombstone (path pageName), and the pin's subject is the one with a path. Selecting on `expected === 'never'` names the tombstone directly and the message assertion is kept alongside. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH
1 parent 4b69082 commit fa6ee04

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3953,9 +3953,17 @@ describe("ListViewSchema — the RETIRED `page` view type (#17063)", () => {
39533953
it('REFUSES `pageName` with the tombstone prescription, not a bare unknown-key report', () => {
39543954
const r = parse({ type: 'grid', pageName: 'sales_dashboard', columns: ['name'] });
39553955
expect(r.success).toBe(false);
3956+
// Select the TOMBSTONE issue by the shape `retiredKey()` raises rather
3957+
// than by its text. Since #17299 the overlay door also carries that text
3958+
// on the union WRAPPER (path `[]`), lifted verbatim from the issue below,
3959+
// so a text-only find is satisfied by either and this pin's subject —
3960+
// that the refusal is raised at the key the author wrote — needs the one
3961+
// that has a path. The two are asserted equal in
3962+
// `view-union-retirement-prescription.test.ts`.
39563963
const issue = flatten((r as { error: z.ZodError }).error.issues)
3957-
.find((i) => i.message.includes('`view.pageName` was removed'));
3964+
.find((i) => (i as { expected?: string }).expected === 'never');
39583965
expect(issue, JSON.stringify((r as { error: z.ZodError }).error.issues)).toBeDefined();
3966+
expect(issue!.message).toContain('`view.pageName` was removed');
39593967
expect(issue!.path.join('.')).toBe('pageName');
39603968
});
39613969

0 commit comments

Comments
 (0)