Skip to content

Commit 08d6fec

Browse files
committed
test(app-shell): exact publish requests now carry the Save's own draft pin
Claude-Session: https://claude.ai/code/session_01L6bhgWAbKPqt7vTgX5qgUn Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2bf6675 commit 08d6fec

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎ui/packages/app-shell/src/views/studio-design/AutomationsPillar.customizeFlow-28570.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,10 @@ describe('Customize a read-only base’s flow into its pair (objectstack#28570)'
359359
// Then that one flow is published at the pair: the override is live. Read
360360
// at the base, the Save takes the pair to hold no live flow of the name,
361361
// and its publish asserts so (objectstack#36726).
362-
await waitFor(() => expect(srv.publishes).toEqual([{ name: FLOW_NAME, opts: { packageId: PAIR, ifNoneMatch: '*' } }]));
362+
await waitFor(() => expect(srv.publishes).toEqual([
363+
// objectstack#37440 — and to the draft this Save wrote (its receipt).
364+
{ name: FLOW_NAME, opts: { packageId: PAIR, ifNoneMatch: '*', draftVersion: expect.any(String) } },
365+
]));
363366
expect(srv.ensure).toEqual([201]);
364367
const [saved] = srv.saves;
365368
expect(saved!.name).toBe(FLOW_NAME);

‎ui/packages/app-shell/src/views/studio-design/DataPillar.pairActions-30088.test.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ describe('Studio adds an action to an installed app’s object, in its customiza
284284
expect(opts).toMatchObject({ mode: 'draft', packageId: PAIR, ifNoneMatch: '*' });
285285
// Then that one action is published at the pair: live at once, asserting
286286
// no published action of its name (objectstack#36726).
287-
expect(mockClient.publish).toHaveBeenCalledWith('action', name, { packageId: PAIR, ifNoneMatch: '*' });
287+
// objectstack#37440 — pinned to the draft this Save wrote (its receipt), too.
288+
expect(mockClient.publish).toHaveBeenCalledWith('action', name, { packageId: PAIR, ifNoneMatch: '*', draftVersion: expect.any(String) });
288289
expect(mockClient.save.mock.invocationCallOrder[0]).toBeLessThan(mockClient.publish.mock.invocationCallOrder[0]);
289290
expect(ensure).toHaveBeenCalledTimes(1);
290291
expect(saves().filter(([type]) => type === 'object')).toHaveLength(0);
@@ -323,7 +324,7 @@ describe('Studio adds an action to an installed app’s object, in its customiza
323324
// The read's decorations are not written back.
324325
expect(body).not.toHaveProperty('_packageId');
325326
expect(opts).toMatchObject({ mode: 'draft', packageId: PAIR });
326-
expect(mockClient.publish).toHaveBeenCalledWith('action', KEPT.name, { packageId: PAIR });
327+
expect(mockClient.publish).toHaveBeenCalledWith('action', KEPT.name, { packageId: PAIR, draftVersion: expect.any(String) });
327328
expect(saves().filter(([type]) => type === 'object')).toHaveLength(0);
328329

329330
fireEvent.click(screen.getByRole('button', { name: L('engine.studio.actions.delete') }));

‎ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.draftVersionConflict-11773.test.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ describe('Data pillar — a draft saved elsewhere is not overwritten in silence
336336
// The draft was read at the package the saves write.
337337
expect(mockClient.getDraft).toHaveBeenCalledWith('object', OBJECT.name, { packageId: PKG });
338338
expect(server.saves.every((s) => s.packageId === PKG)).toBe(true);
339-
expect(mockClient.publish).toHaveBeenCalledWith('object', OBJECT.name, { packageId: PKG });
339+
// objectstack#37440 — each publish is pinned to the draft its own Save wrote (its receipt).
340+
expect(mockClient.publish).toHaveBeenCalledWith('object', OBJECT.name, { packageId: PKG, draftVersion: expect.any(String) });
340341
expect(liveFields()).toEqual(['title', 'status', 'new_field', 'second_field']);
341342
expect(screen.queryByTestId('draft-conflict-dialog')).toBeNull();
342343
});

0 commit comments

Comments
 (0)