refactor(new merge) (#369)

Co-authored-by: paisley <8197966+su8su@users.noreply.github.com>
Co-authored-by: zuolingxuan <zuolingxuan@bytedance.com>
This commit is contained in:
Lingxuan Zuo
2026-03-09 20:18:25 +08:00
committed by GitHub
Unverified
parent e28eba01e1
commit 3d664c017a
18 changed files with 514 additions and 390 deletions

View File

@@ -68,6 +68,16 @@ describe('api-client', () => {
expect(msg).toContain('Permission denied');
});
it('returns user-facing message for auth invalid error', () => {
const msg = toUserMessage(new AppError('AUTH_INVALID', 'Invalid Authentication'));
expect(msg).toContain('Authentication failed');
});
it('returns user-facing message for channel unavailable error', () => {
const msg = toUserMessage(new AppError('CHANNEL_UNAVAILABLE', 'Invalid IPC channel'));
expect(msg).toContain('Service channel unavailable');
});
it('falls back to legacy channel when unified route is unsupported', async () => {
const invoke = vi.mocked(window.electron.ipcRenderer.invoke);
invoke