Skip to content

Commit c5545a5

Browse files
committed
test(service-automation): the notify title case asserts both doors — registration refuses, the executor refuses past the doors
Claude-Session: https://claude.ai/code/session_01T9u38rswFp5Rw8DswRUReJ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 00bf19b commit c5545a5

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎packages/services/service-automation/src/builtin/notify-template-slots.test.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,16 @@ describe('notify — title / message are template slots', () => {
114114
expect(payload).toMatchObject(RENDERED);
115115
});
116116

117-
it('refuses a value that is neither a string nor a template envelope at the contract parse, before anything is sent', async () => {
118-
const { result } = await deliveredFor({ title: 42 });
117+
it('refuses a value that is neither a string nor a template envelope — at registration, and at the contract parse past the doors, before anything is sent', async () => {
118+
// The flow parse judges a builtin node's present config value
119+
// against its executor contract, so registration refuses it at the key…
120+
expect(() => engine.registerFlow('notify_template_flow', notifyFlow({ recipients: ['user_1'], title: 42 })))
121+
.toThrow(/refused at `title`/);
122+
// …and the executor still refuses one that reaches it past the doors.
123+
const stored = engine.registerFlow('notify_template_flow', notifyFlow({ recipients: ['user_1'], title: TITLE }));
124+
const node = stored.nodes.find((n) => n.id === 'notify')!;
125+
node.config = { ...node.config, title: 42 };
126+
const result = await engine.execute('notify_template_flow', { params: PARAMS } as any);
119127
expect(result.success).toBe(false);
120128
expect(String(result.error)).toContain('does not satisfy the notify contract');
121129
expect(String(result.error)).toContain('config.title');

0 commit comments

Comments
 (0)