Skip to content

Commit db727d0

Browse files
committed
test(runtime): pin the draft read's ?package=all on both hosts
The Studio editor reads a pending draft back with its raw router ?package=, so under the list's "show everything" scope it sends ?state=draft&package=all. Both hosts now serve the draft ?state=draft serves. Claude-Session: https://claude.ai/code/session_01RWZbGvPFcRKvUqASZtunCU Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a13568b commit db727d0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎packages/runtime/src/domains/meta-package-all-fold.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,17 @@ for (const [doorName, boot] of DOORS) {
289289
expect(served(await door.read('/meta/view/case_grid', { package: 'all' })).item).toEqual(plain.item);
290290
}, 60_000);
291291

292+
it('the draft read: ?state=draft&package=all serves the draft ?state=draft serves', async () => {
293+
const door = await boot();
294+
// A draft saved naming no package inherits the package of the
295+
// item's active row (#11087): the draft the Studio editor reads
296+
// back with its raw router `?package=`.
297+
served(await door.put('/meta/view/case_grid', view('case_grid', 'staged'), { mode: 'draft' }));
298+
const plain = served(await door.read('/meta/view/case_grid', { state: 'draft' }));
299+
expect(plain.item?.label).toBe('staged');
300+
expect(served(await door.read('/meta/view/case_grid', { state: 'draft', package: 'all' })).item).toEqual(plain.item);
301+
}, 60_000);
302+
292303
it('the save: PUT ?package=all writes the env-local row, as a save naming no package does; a real package id still binds', async () => {
293304
const door = await boot();
294305
served(await door.put('/meta/view/fresh_grid', view('fresh_grid', 'unscoped'), { package: 'all' }));

0 commit comments

Comments
 (0)