test(companion): cover platform connected lifecycle integration

This commit is contained in:
William Valentin
2026-02-16 19:38:49 -08:00
parent 3a1e52c938
commit ebb62ffb65
2 changed files with 26 additions and 0 deletions
+11
View File
@@ -749,6 +749,17 @@
],
"test_status": "pnpm test:run src/companion/platformClients.test.ts src/companion/runtimeClient.test.ts src/companion/heartbeatLoop.test.ts src/companion/platformClients.integration.test.ts + pnpm typecheck passing"
},
"companion-platform-connected-integration-coverage": {
"status": "completed",
"date": "2026-02-17",
"updated": "2026-02-17",
"summary": "Added live gateway integration coverage to verify platform `connected` passthrough tracks runtime WebSocket connect/disconnect lifecycle.",
"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/platformClients.test.ts src/companion/runtimeClient.test.ts src/companion/heartbeatLoop.test.ts + pnpm typecheck passing"
},
"browser-tools-activation-clarity": {
"status": "completed",
"date": "2026-02-17",
@@ -108,6 +108,21 @@ function createRuntime(): CompanionRuntimeClient {
}
describe('platform clients integration', () => {
it('platform connected reflects runtime connection lifecycle', async () => {
if (!LISTEN_ALLOWED) {
return;
}
const runtime = createRuntime();
const client = new IOSCompanionClient({ runtime, nodeId: 'ios-connected-e2e' });
expect(client.connected).toBe(false);
await client.connect();
expect(client.connected).toBe(true);
client.disconnect();
expect(client.connected).toBe(false);
});
it('macOS companion wrapper registers and writes status with platform pinning', async () => {
if (!LISTEN_ALLOWED) {
return;