Skip to content

Commit a691ee4

Browse files
committed
test(objectql): the duplicate's flow node config follows the renamed object
Claude-Session: https://claude.ai/code/session_01YRp5z4kK6vgYkrdH97ztsy Co-authored-by: Claude <noreply@anthropic.com>
1 parent 681ace4 commit a691ee4

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎packages/objectql/src/protocol-duplicate-package-unprefixed-object.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ const ticketViewsBody = {
146146
name: 'ticket_views', object: 'ticket',
147147
list: { label: 'All tickets', type: 'grid', columns: [{ field: 'title' }] },
148148
};
149+
/** A flow binds its object on a node `config`, which the derived site index does not walk. */
150+
const onTicketBody = {
151+
name: 'dupsrc_on_ticket', label: 'On ticket', type: 'record_change',
152+
nodes: [
153+
{ id: 'start', type: 'start', label: 'Start', config: { objectName: 'ticket', triggerType: 'record-after-create' } },
154+
{ id: 'end', type: 'end', label: 'End' },
155+
],
156+
edges: [{ id: 'e1', source: 'start', target: 'end' }],
157+
};
149158
const opsBody = {
150159
name: 'dupsrc_ops', label: 'Ops',
151160
objects: { dupsrc_customer: { allowRead: true }, ticket: { allowRead: true } },
@@ -194,6 +203,7 @@ describe('ADR-0070 D4 — duplicatePackage of an object whose name lacks the sou
194203
await save('object', noteBody);
195204
await save('view', ticketViewsBody);
196205
await save('permission', opsBody);
206+
await save('flow', onTicketBody);
197207
for (const [type, item] of extra) await save(type, item);
198208
// CONTROL: the bare name was stored by a direct save, no prefix gate read it.
199209
expect(owner('ticket')).toBe(P);
@@ -239,6 +249,7 @@ describe('ADR-0070 D4 — duplicatePackage of an object whose name lacks the sou
239249
expect(noteCopy.fields.ticket.name).toBe('ticket');
240250

241251
expect(storedBody('view', 'ticket_views', Q).object).toBe('dupdst_ticket');
252+
expect(storedBody('flow', 'dupdst_on_ticket', Q).nodes[0].config.objectName).toBe('dupdst_ticket');
242253
// A permission set is keyed by object name: both grants follow.
243254
expect(Object.keys(storedBody('permission', 'dupdst_ops', Q).objects).sort())
244255
.toEqual(['dupdst_customer', 'dupdst_ticket']);

0 commit comments

Comments
 (0)