feat(companion): add platform bootstrap helper

This commit is contained in:
William Valentin
2026-02-16 18:34:57 -08:00
parent 97afc39e01
commit 4d29c381f7
6 changed files with 60 additions and 1 deletions
+17
View File
@@ -151,4 +151,21 @@ describe('platform companion clients', () => {
expect(mock.deleteCanvasArtifact).toHaveBeenCalledWith({ sessionId: 'ws:test-canvas', artifactId: 'a1' });
expect(mock.clearCanvasArtifacts).toHaveBeenCalledWith('ws:test-canvas');
});
it('bootstrap registers node and then fetches capabilities', async () => {
const mock = createRuntimeMock();
const client = new IOSCompanionClient({ runtime: mock.runtime, nodeId: 'ios-node' });
const result = await client.bootstrap();
expect(mock.registerNode).toHaveBeenCalledOnce();
expect(mock.getNodeCapabilities).toHaveBeenCalledOnce();
expect(mock.registerNode.mock.invocationCallOrder[0]).toBeLessThan(
mock.getNodeCapabilities.mock.invocationCallOrder[0],
);
expect(result).toEqual({
register: { registered: true },
capabilities: expect.any(Object),
});
});
});