feat: update openclaw and polish desktop flows

This commit is contained in:
inman
2026-05-13 21:52:17 +08:00
parent 7c8781a6e3
commit 86795078f7
22 changed files with 1145 additions and 186 deletions

View File

@@ -81,6 +81,21 @@ describe('host-api', () => {
await expect(hostApiFetch('/api/test')).rejects.toThrow('Invalid Authentication');
});
it('throws message from unified non-ok Host API responses', async () => {
invokeIpcMock.mockResolvedValueOnce({
ok: true,
data: {
status: 500,
ok: false,
json: { success: false, error: 'WhatsApp startup failed' },
},
});
const { hostApiFetch } = await import('@/lib/host-api');
await expect(hostApiFetch('/api/channels/whatsapp/start', { method: 'POST' }))
.rejects.toThrow('WhatsApp startup failed');
});
it('falls back to browser fetch only when IPC channel is unavailable', async () => {
const fetchMock = vi.fn().mockResolvedValue({
ok: true,