From 0bf44d557f4564c9d7d84cbf7632b02015f00271 Mon Sep 17 00:00:00 2001 From: nousbot-eng Date: Fri, 17 Jul 2026 10:30:29 -0400 Subject: [PATCH] fmt(js): `npm run fix` on merge (#66348) Co-authored-by: github-actions[bot] --- .../src/lib/mcp-dashboard-oauth.test.ts | 45 ++++++++++++------- apps/desktop/src/lib/mcp-dashboard-oauth.ts | 5 +-- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/apps/desktop/src/lib/mcp-dashboard-oauth.test.ts b/apps/desktop/src/lib/mcp-dashboard-oauth.test.ts index 18ea5e93ac6f..0c2e315134a5 100644 --- a/apps/desktop/src/lib/mcp-dashboard-oauth.test.ts +++ b/apps/desktop/src/lib/mcp-dashboard-oauth.test.ts @@ -9,20 +9,29 @@ describe('completeMcpDesktopOAuth', () => { const status = vi .fn() .mockResolvedValueOnce({ - flow_id: 'flow-1', server_name: 'reports', status: 'authorization_required', - authorization_url: 'https://idp.example/authorize', error: null + flow_id: 'flow-1', + server_name: 'reports', + status: 'authorization_required', + authorization_url: 'https://idp.example/authorize', + error: null }) .mockResolvedValueOnce({ - flow_id: 'flow-1', server_name: 'reports', status: 'approved', - authorization_url: 'https://idp.example/authorize', error: null, + flow_id: 'flow-1', + server_name: 'reports', + status: 'approved', + authorization_url: 'https://idp.example/authorize', + error: null, tools: [{ name: 'list_reports', description: 'List reports' }] }) const result = await completeMcpDesktopOAuth({ serverName: 'reports', start: vi.fn().mockResolvedValue({ - flow_id: 'flow-1', server_name: 'reports', status: 'authorization_required', - authorization_url: 'https://idp.example/authorize', error: null + flow_id: 'flow-1', + server_name: 'reports', + status: 'authorization_required', + authorization_url: 'https://idp.example/authorize', + error: null }), status, openExternal, @@ -34,19 +43,23 @@ describe('completeMcpDesktopOAuth', () => { }) it('retries a transient status failure', async () => { - const status = vi - .fn() - .mockRejectedValueOnce(new Error('temporary network failure')) - .mockResolvedValueOnce({ - flow_id: 'flow-2', server_name: 'reports', status: 'approved', - authorization_url: 'https://idp.example/authorize', error: null, tools: [] - }) + const status = vi.fn().mockRejectedValueOnce(new Error('temporary network failure')).mockResolvedValueOnce({ + flow_id: 'flow-2', + server_name: 'reports', + status: 'approved', + authorization_url: 'https://idp.example/authorize', + error: null, + tools: [] + }) const result = await completeMcpDesktopOAuth({ serverName: 'reports', start: vi.fn().mockResolvedValue({ - flow_id: 'flow-2', server_name: 'reports', status: 'authorization_required', - authorization_url: 'https://idp.example/authorize', error: null + flow_id: 'flow-2', + server_name: 'reports', + status: 'authorization_required', + authorization_url: 'https://idp.example/authorize', + error: null }), status, openExternal: vi.fn().mockResolvedValue(undefined), @@ -56,4 +69,4 @@ describe('completeMcpDesktopOAuth', () => { expect(result.status).toBe('approved') expect(status).toHaveBeenCalledTimes(2) }) -}) \ No newline at end of file +}) diff --git a/apps/desktop/src/lib/mcp-dashboard-oauth.ts b/apps/desktop/src/lib/mcp-dashboard-oauth.ts index 2015540e9b0c..b26f1df11a59 100644 --- a/apps/desktop/src/lib/mcp-dashboard-oauth.ts +++ b/apps/desktop/src/lib/mcp-dashboard-oauth.ts @@ -16,8 +16,7 @@ interface CompleteOptions { maxPollFailures?: number } -const defaultSleep = (milliseconds: number) => - new Promise(resolve => window.setTimeout(resolve, milliseconds)) +const defaultSleep = (milliseconds: number) => new Promise(resolve => window.setTimeout(resolve, milliseconds)) export async function completeMcpDesktopOAuth({ serverName, @@ -69,4 +68,4 @@ export async function completeMcpDesktopOAuth({ await sleep(1000) } -} \ No newline at end of file +}