Optimize gateway comms reload behavior and strengthen regression coverage (#496)

This commit is contained in:
Lingxuan Zuo
2026-03-15 20:36:48 +08:00
committed by GitHub
Unverified
parent 08960d700f
commit 1dbe4a8466
36 changed files with 1511 additions and 197 deletions

View File

@@ -244,4 +244,24 @@ describe('api-client', () => {
expect(result.success).toBe(true);
expect(result.result.channels[0].id).toBe('telegram-default');
});
it('rejects invalid config.patch params before gateway:httpProxy call', async () => {
const invoke = vi.mocked(window.electron.ipcRenderer.invoke);
const invoker = createGatewayHttpTransportInvoker();
await expect(invoker('gateway:rpc', ['config.patch', 'abc'])).rejects.toThrow(
'gateway:rpc config.patch requires object params',
);
expect(invoke).not.toHaveBeenCalled();
});
it('rejects invalid config.patch.patch before gateway:httpProxy call', async () => {
const invoke = vi.mocked(window.electron.ipcRenderer.invoke);
const invoker = createGatewayHttpTransportInvoker();
await expect(invoker('gateway:rpc', ['config.patch', { patch: 'abc' }])).rejects.toThrow(
'gateway:rpc config.patch requires object patch',
);
expect(invoke).not.toHaveBeenCalled();
});
});