Skip to content

Commit da697f3

Browse files
committed
test(cloud-connection): route the seed-copy harness's writes through the engine dispatch asserts
Claude-Session: https://claude.ai/code/session_01FEkQ5pQJCx8STEq28nr3Ej Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5620dd9 commit da697f3

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎packages/cloud-connection/src/marketplace-install-local-install-modes.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { MarketplaceInstallLocalPlugin } from './marketplace-install-local-plugi
3737
import { declareInstallerPlatformOwner, installerAuthService, withInstallerGrants } from './install-local-principal.fixtures.js';
3838
import { LocalManifestSource } from './local-manifest-source.js';
3939
import { ObjectStackProtocolImplementation } from '@objectstack/metadata-protocol';
40+
import { assertEngineDeleteDispatch, assertEngineUpdateDispatch } from '@objectstack/metadata-core';
4041

4142
const ROUTE = '/api/v1/marketplace/install-local';
4243
const INSTALLER = 'usr_installer';
@@ -705,6 +706,7 @@ describe('install-local — an unmanaged copy\'s sample data, asked for with `se
705706
return Array.isArray(record) ? record.map(one) : one(record);
706707
},
707708
async update(object: string, data: Record<string, unknown>, options: any) {
709+
assertEngineUpdateDispatch(data, options);
708710
let n = 0;
709711
for (const row of known(object)) {
710712
if (!matches(row, options?.where ?? {})) continue;
@@ -714,6 +716,7 @@ describe('install-local — an unmanaged copy\'s sample data, asked for with `se
714716
return n;
715717
},
716718
async delete(object: string, options?: any): Promise<boolean> {
719+
assertEngineDeleteDispatch(options);
717720
const id = String(options?.where?.id ?? '');
718721
const table = known(object);
719722
const at = table.findIndex((r) => r.id === id);

‎scripts/engine-double-contract.pinned.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@
1616
"verb": "delete",
1717
"pinned": 1
1818
},
19+
{
20+
"file": "packages/cloud-connection/src/marketplace-install-local-install-modes.test.ts",
21+
"verb": "delete",
22+
"pinned": 1
23+
},
24+
{
25+
"file": "packages/cloud-connection/src/marketplace-install-local-install-modes.test.ts",
26+
"verb": "update",
27+
"pinned": 1
28+
},
1929
{
2030
"file": "packages/cloud-connection/src/marketplace-install-local-sample-data-not-loaded.test.ts",
2131
"verb": "delete",

0 commit comments

Comments
 (0)