feat(companion): add publishHeartbeat helper across platform clients
This commit is contained in:
@@ -168,4 +168,19 @@ describe('platform companion clients', () => {
|
||||
capabilities: expect.any(Object),
|
||||
});
|
||||
});
|
||||
|
||||
it('publishHeartbeat uses safe defaults for status payload', async () => {
|
||||
const mock = createRuntimeMock();
|
||||
const client = new AndroidCompanionClient({ runtime: mock.runtime, nodeId: 'android-node' });
|
||||
|
||||
await client.publishHeartbeat();
|
||||
|
||||
expect(mock.setNodeStatus).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
platform: 'android',
|
||||
statusText: 'heartbeat',
|
||||
powerSource: 'unknown',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user