test(companion): verify clearEventSubscriptions count integration
This commit is contained in:
@@ -1162,6 +1162,17 @@
|
||||
],
|
||||
"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"
|
||||
},
|
||||
"companion-platform-clear-event-subscriptions-count-integration": {
|
||||
"status": "completed",
|
||||
"date": "2026-02-17",
|
||||
"updated": "2026-02-17",
|
||||
"summary": "Added platform integration assertions for `clearEventSubscriptions()` count-return semantics (`clearedSubscriptions`, `cancelledWaits`) during active waiter/subscription teardown.",
|
||||
"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"
|
||||
},
|
||||
"companion-runtime-wait-for-idle-nonfinite-validation-coverage": {
|
||||
"status": "completed",
|
||||
"date": "2026-02-17",
|
||||
|
||||
@@ -299,6 +299,28 @@ describe('platform clients integration', () => {
|
||||
unsubscribe();
|
||||
});
|
||||
|
||||
it('platform clearEventSubscriptions returns cleared and cancelled counts', async () => {
|
||||
if (!LISTEN_ALLOWED) {
|
||||
return;
|
||||
}
|
||||
|
||||
const runtime = createRuntime();
|
||||
const client = new IOSCompanionClient({ runtime, nodeId: 'ios-clear-counts-e2e' });
|
||||
|
||||
const unsubscribe = client.subscribeEvents(() => undefined);
|
||||
const pending = client.waitForAnyEvent(['agent.stream'], { timeoutMs: 10_000 }).catch(() => undefined);
|
||||
|
||||
const cleared = client.clearEventSubscriptions();
|
||||
expect(cleared).toEqual({
|
||||
clearedSubscriptions: 2,
|
||||
cancelledWaits: 1,
|
||||
});
|
||||
|
||||
await pending;
|
||||
expect(client.eventSubscriptionCount).toBe(0);
|
||||
unsubscribe();
|
||||
});
|
||||
|
||||
it('platform connected reflects runtime connection lifecycle', async () => {
|
||||
if (!LISTEN_ALLOWED) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user