feat: update openclaw and polish desktop flows
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user