test(companion): add platform canvas lifecycle integration coverage
This commit is contained in:
@@ -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