Skip to content

Commit 17adf26

Browse files
committed
test(objectql): the close of a write naming the base leaves a view container's write open
Claude-Session: https://claude.ai/code/session_01Utp6CbC5BpV41NMLrJMt8Q Co-authored-by: Claude <noreply@anthropic.com>
1 parent efbca75 commit 17adf26

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎packages/objectql/src/protocol-packageless-overlay-migration.test.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,18 @@ describe('[#30261] a view container cannot carry the declaration: the preview sa
891891
expect(rows(CONTAINER)).toEqual([[null, 'active']]);
892892
});
893893

894+
it('the close of a write naming the read-only base leaves it too: its fix, a declared save into the pair, cannot be taken', async () => {
895+
const { protocol, rows } = await boot();
896+
const named = await refusalOf(protocol.saveMetaItem({ type: 'view', name: CONTAINER, packageId: BASE, item: containerBody(EDITED_COLUMNS) } as any));
897+
expect(named).toBeUndefined();
898+
expect(rows(CONTAINER)).toEqual([[BASE, 'active']]);
899+
// …and the row it stored is the census's, listed with the same way out, bound to the base.
900+
const listedCensus = await census(protocol);
901+
expect(listedCensus.rows.map((r: any) => `${r.name}@${r.state} ${r.disposition} ${r.boundToBase}`)).toEqual([`${CONTAINER}@active cannot_declare true`]);
902+
expect(await refusalOf(protocol.deleteMetaItem({ type: 'view', name: CONTAINER, packageId: BASE } as any))).toBeUndefined();
903+
expect(rows(CONTAINER)).toEqual([]);
904+
});
905+
894906
it('the way out the preview names holds: each view saved into the pair as a single view, then the container deleted naming no package, leaves nothing to list', async () => {
895907
const { engine, protocol, rows } = await boot();
896908
await storeContainer(engine, UNBOUND_COLUMNS);

0 commit comments

Comments
 (0)