Skip to content

Commit 34eb15a

Browse files
committed
test(spec): pin the container members' refusal on the template-envelope confirmText form
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgVugtCCwBs98FeR27P
1 parent 73fb6b9 commit 34eb15a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎packages/spec/src/ui/action-confirm-params-guard.test.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,18 @@ describe('`confirmText` + non-empty ARRAY `params` is refused on `action:icon` a
455455
expect(issues[0]?.message).toContain('`description`');
456456
});
457457

458-
it(`an \`${row}\` member refuses the localized-map form of \`confirmText\` too`, () => {
458+
it(`an \`${row}\` member refuses the template-envelope form of \`confirmText\` too`, () => {
459+
// A row's `confirmText` is a template slot: the bare string and the
460+
// `{ dialect: 'template', source }` envelope are its two spellings (a
461+
// localized map is refused by the slot itself, for its own reason).
459462
const result = schema.safeParse(asContainer({
460463
...memberReject,
461-
confirmText: { en: 'Reject this request?', 'zh-CN': '拒绝该请求?' },
464+
confirmText: { dialect: 'template', source: 'Reject this request?' },
462465
}));
463466

464467
expect(result.success).toBe(false);
465-
expect(result.success ? [] : result.error.issues.map((i) => i.path.join('.'))).toEqual(['actions.1.confirmText']);
468+
expect(result.success ? [] : result.error.issues.map((i) => [i.code, i.path.join('.')]))
469+
.toEqual([['custom', 'actions.1.confirmText']]);
466470
});
467471
}
468472

0 commit comments

Comments
 (0)