test(companion): add platform canvas lifecycle integration coverage
This commit is contained in:
@@ -246,6 +246,17 @@
|
||||
],
|
||||
"test_status": "pnpm test:run src/companion/runtimeClient.test.ts src/companion/platformClients.test.ts src/companion/platformClients.integration.test.ts + pnpm typecheck passing"
|
||||
},
|
||||
"companion-platform-canvas-integration-coverage": {
|
||||
"status": "completed",
|
||||
"date": "2026-02-17",
|
||||
"updated": "2026-02-17",
|
||||
"summary": "Extended live integration coverage for `MacOSCompanionClient` to validate canvas artifact lifecycle (`put/get/list/delete/clear`) through platform wrappers against gateway handlers.",
|
||||
"files_modified": [
|
||||
"src/companion/platformClients.integration.test.ts",
|
||||
"docs/plans/state.json"
|
||||
],
|
||||
"test_status": "pnpm test:run src/companion/platformClients.integration.test.ts src/companion/runtimeClient.test.ts src/companion/platformClients.test.ts + pnpm typecheck passing"
|
||||
},
|
||||
"browser-tools-activation-clarity": {
|
||||
"status": "completed",
|
||||
"date": "2026-02-17",
|
||||
|
||||
@@ -189,4 +189,42 @@ describe('platform clients integration', () => {
|
||||
client.disconnect();
|
||||
}
|
||||
});
|
||||
|
||||
it('macOS companion wrapper supports canvas artifact lifecycle', async () => {
|
||||
if (!LISTEN_ALLOWED) {
|
||||
return;
|
||||
}
|
||||
|
||||
const runtime = createRuntime();
|
||||
const client = new MacOSCompanionClient({ runtime, nodeId: 'macos-canvas-e2e' });
|
||||
await client.connect();
|
||||
|
||||
try {
|
||||
await client.register();
|
||||
|
||||
const sessionId = 'ws:platform-canvas-e2e';
|
||||
const put = await client.putCanvasArtifact({
|
||||
sessionId,
|
||||
artifactId: 'mac-art-1',
|
||||
type: 'note',
|
||||
content: { text: 'hello from platform wrapper' },
|
||||
});
|
||||
expect(put.upserted).toBe(true);
|
||||
expect(put.artifact.id).toBe('mac-art-1');
|
||||
|
||||
const list = await client.listCanvasArtifacts(sessionId);
|
||||
expect(list.artifacts.some((artifact) => artifact.id === 'mac-art-1')).toBe(true);
|
||||
|
||||
const get = await client.getCanvasArtifact({ sessionId, artifactId: 'mac-art-1' });
|
||||
expect(get.artifact.id).toBe('mac-art-1');
|
||||
|
||||
const del = await client.deleteCanvasArtifact({ sessionId, artifactId: 'mac-art-1' });
|
||||
expect(del.deleted).toBe(true);
|
||||
|
||||
const clear = await client.clearCanvasArtifacts(sessionId);
|
||||
expect(clear.cleared).toBe(0);
|
||||
} finally {
|
||||
client.disconnect();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user