test(companion): verify clearEventSubscriptions count integration
This commit is contained in:
@@ -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