From 08d199169d8e4f6e57da7332657408cc28df058a Mon Sep 17 00:00:00 2001 From: OrcaWin <293788423+OrcaWin@users.noreply.github.com> Date: Wed, 11 Nov 2026 16:18:38 -0800 Subject: [PATCH] test: remove low-value renderer launch and Windows checks --- .../runtime-pointer.test.ps1 | 13 +--- src/cli/linear-format.test.ts | 22 +----- ...tructured-agent-launch-composition.test.ts | 77 ------------------- .../browser-passkey-request-watch.test.ts | 14 ---- .../rich-markdown-prose-entities.test.ts | 21 +---- .../rows/NativeChatMessageRow.test.tsx | 63 --------------- 6 files changed, 4 insertions(+), 206 deletions(-) delete mode 100644 src/renderer/src/components/native-chat/messages/rows/NativeChatMessageRow.test.tsx diff --git a/native/computer-use-windows/runtime-pointer.test.ps1 b/native/computer-use-windows/runtime-pointer.test.ps1 index 347fe912922..84ecd030506 100644 --- a/native/computer-use-windows/runtime-pointer.test.ps1 +++ b/native/computer-use-windows/runtime-pointer.test.ps1 @@ -13,7 +13,6 @@ using System.Collections.Generic; public static class OrcaDesktopWin32 { public static readonly List Calls = new List(); public static bool AllowActivation; - public static bool Minimized; public static IntPtr Foreground; public static IntPtr Pending; public static int FocusReads; @@ -22,14 +21,13 @@ public static class OrcaDesktopWin32 { public static void Reset(bool allow) { Calls.Clear(); AllowActivation = allow; - Minimized = false; Foreground = new IntPtr(202); Pending = IntPtr.Zero; FocusReads = 0; WindowX = 100; } public static bool IsIconic(IntPtr hwnd) { - return Minimized; + return false; } public static bool ShowWindow(IntPtr hwnd, int command) { Calls.Add("restore"); @@ -119,13 +117,4 @@ foreach ($case in @( $result = Invoke-OrcaOperation ([pscustomobject]@{ tool = "click"; app = "Fixture"; element = [pscustomobject]@{ index = 1 } }) Assert-TestEqual $result.action.path "accessibility" "pattern click path" Assert-TestEqual ([OrcaDesktopWin32]::Calls.Count) 0 "pattern click bypasses activation and global input" -[OrcaDesktopWin32]::Reset($true) -Restore-OrcaWindow (Find-OrcaProcess) -Assert-TestEqual (@([OrcaDesktopWin32]::Calls) -join ",") "activate" "non-minimized window skips SW_RESTORE" - -[OrcaDesktopWin32]::Reset($true) -[OrcaDesktopWin32]::Minimized = $true -Restore-OrcaWindow (Find-OrcaProcess) -Assert-TestEqual (@([OrcaDesktopWin32]::Calls) -join ",") "restore,activate" "minimized window runs SW_RESTORE" - Write-Output "windows-pointer-tests-ok" diff --git a/src/cli/linear-format.test.ts b/src/cli/linear-format.test.ts index 712c49b69f8..650a1b8ca6b 100644 --- a/src/cli/linear-format.test.ts +++ b/src/cli/linear-format.test.ts @@ -1,12 +1,8 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { - LinearIssueContextResult, - LinearTeamMembersResult -} from '../shared/linear/agent-access' +import type { LinearIssueContextResult } from '../shared/linear/agent-access' import { formatLinearIssue, formatLinearMcpIssueList, - formatLinearTeamMembers, printLinearMcpIssueListWarnings } from './linear-format' @@ -127,20 +123,4 @@ describe('linear-format', () => { 'warning: Acme unavailable for Linear: rate limited warning: fake' ) }) - - it('pads member names by terminal columns so wide Hangul names keep the id column aligned', () => { - const result: LinearTeamMembersResult = { - team: { id: 'team-1', name: 'Engineering', key: 'ENG' }, - members: [ - { id: 'user-0', displayName: '김철수' }, - { id: 'user-1', displayName: 'Alice' } - ], - meta: { workspaceId: 'workspace-1', returned: 2 } - } - - expect(formatLinearTeamMembers(result).split('\n')).toEqual([ - `김철수${' '.repeat(18)} user-0`, - `Alice${' '.repeat(19)} user-1` - ]) - }) }) diff --git a/src/main/runtime/agent-session/launch/structured-agent-launch-composition.test.ts b/src/main/runtime/agent-session/launch/structured-agent-launch-composition.test.ts index d74444f5686..22d16a2a74a 100644 --- a/src/main/runtime/agent-session/launch/structured-agent-launch-composition.test.ts +++ b/src/main/runtime/agent-session/launch/structured-agent-launch-composition.test.ts @@ -3,7 +3,6 @@ import { ORCA_SCRUB_SAFE_PANE_ENV } from '../../../../shared/agent-hook-listener import type { AgentSessionJournalIdentity } from '../../../../shared/agent-session/journal/agent-session-journal-identity' import type { AgentSessionAccountHome } from '../../../../shared/agent-session/lifecycle/agent-session-account-home' import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' -import { acpLaunchSpecFor } from '../../../acp/launch/acp-launch-registry' import { agentSessionRecordFixture } from '../../../native-chat/agent-session-record-test-fixture' import { resolveProviderChildEnv } from '../../../provider-process/provider-process-launch' import { @@ -12,22 +11,10 @@ import { structuredWorkerIdentities } from '../../orchestration/terminal-authority/structured-sessions/structured-worker-identity' import { - createAcpStructuredLaunchResolver, - createClaudeStructuredLaunchResolver, createCodexStructuredLaunchResolver, - createPiRpcLaunchResolver, TEST_SPAWN_TOKEN } from './structured-agent-launch-composition.test-support' -const { isWindowsProcessStartTimeAvailable } = vi.hoisted(() => ({ - isWindowsProcessStartTimeAvailable: vi.fn(() => true) -})) - -vi.mock('../../../windows/windows-process-table', async (importOriginal) => ({ - ...(await importOriginal()), - isWindowsProcessStartTimeAvailable -})) - afterEach(() => { structuredWorkerIdentities.clear() }) @@ -82,70 +69,6 @@ function expectNoHostPaneIdentity(childEnv: NodeJS.ProcessEnv): void { } describe('structured agent launch composition pane-identity stripping', () => { - it('strips inherited host-pane identity across Claude, Codex, ACP, and Pi launches', async () => { - const claudeLaunch = await createClaudeStructuredLaunchResolver({ - store: makeStore('00000000-0000-4000-8000-000000000001', 'claude', { - variable: 'CLAUDE_CONFIG_DIR', - path: '/home/work/.claude' - }), - resolveInheritedEnv: async () => ({ ...INHERITED_PANE_ENV }), - resolveCommand: () => ({ command: '/usr/local/bin/claude', prefixArgs: [] }), - resolveAuthPolicy: () => ({ account: 'system' }), - hasTranscript: async () => false, - resolveLaunchArgs: () => [] - })({ identity: makeIdentity('00000000-0000-4000-8000-000000000001', 'claude') }) - - const codexLaunch = await createCodexStructuredLaunchResolver({ - store: makeStore('00000000-0000-4000-8000-000000000002', 'codex', { - variable: 'CODEX_HOME', - path: '/home/work/.codex' - }), - resolveEnvironment: async () => ({ ...INHERITED_PANE_ENV }), - resolveCommand: () => ({ command: '/usr/local/bin/codex', prefixArgs: [] }), - resolveLaunchArgs: () => [] - })({ - identity: makeIdentity('00000000-0000-4000-8000-000000000002', 'codex'), - spawnToken: TEST_SPAWN_TOKEN - }) - - const grokSpec = acpLaunchSpecFor('grok') - if (!grokSpec) { - throw new Error('Missing Grok ACP launch spec') - } - const acpLaunch = await createAcpStructuredLaunchResolver(grokSpec, { - store: makeStore('00000000-0000-4000-8000-000000000003', 'grok', { - variable: 'GROK_HOME', - path: '/home/work/.grok' - }), - resolveEnvironment: async () => ({ ...INHERITED_PANE_ENV }), - inheritedEnv: INHERITED_PANE_ENV, - readJournal: () => null, - resolveCommand: () => '/usr/local/bin/grok', - probeVersion: async () => ({ version: '1.0.0' }) - })({ - identity: makeIdentity('00000000-0000-4000-8000-000000000003', 'grok'), - spawnToken: TEST_SPAWN_TOKEN - }) - - const piLaunch = await createPiRpcLaunchResolver({ - store: makeStore('00000000-0000-4000-8000-000000000004', 'pi', { - variable: 'PI_CODING_AGENT_DIR', - path: '/home/work/.pi' - }), - resolveEnvironment: async () => ({ ...INHERITED_PANE_ENV }), - resolveCommand: () => '/usr/local/bin/pi', - probeVersion: async () => ({ version: '0.84.0' }), - resolveFullAccess: () => true, - ensureBackgroundWorkBridge: async () => null - })(makeIdentity('00000000-0000-4000-8000-000000000004', 'pi'), TEST_SPAWN_TOKEN) - - for (const launch of [claudeLaunch, codexLaunch, acpLaunch, piLaunch]) { - const childEnv = resolveProviderChildEnv(launch, INHERITED_PANE_ENV) - expectNoHostPaneIdentity(childEnv) - expect(childEnv.ORCA_TERMINAL_HANDLE).toBeUndefined() - } - }) - it("preserves a structured worker's own ORCA_TERMINAL_HANDLE while stripping host pane identity", async () => { const sessionId = '00000000-0000-4000-8000-000000000005' const workerHandle = mintStructuredWorkerHandle() diff --git a/src/preload/browser-passkey-request-watch.test.ts b/src/preload/browser-passkey-request-watch.test.ts index 7b01b01ba5c..67e75358272 100644 --- a/src/preload/browser-passkey-request-watch.test.ts +++ b/src/preload/browser-passkey-request-watch.test.ts @@ -54,20 +54,6 @@ describe('installBrowserPasskeyRequestWatch', () => { expect(reports).toEqual([true, false]) }) - it('installs nothing in an insecure document, which has no credentials API', () => { - Reflect.deleteProperty(globalThis, 'CredentialsContainer') - const reports: boolean[] = [] - const cancel = installBrowserPasskeyRequestWatch((pending) => reports.push(pending)) - cancel() - expect(reports).toEqual([]) - }) - - it('ignores conditional requests, which wait on autofill', () => { - const { credentials, reports } = install() - void credentials.get({ publicKey, mediation: 'conditional' }) - expect(reports).toEqual([]) - }) - it("keeps the page's own abort signal working", async () => { const { credentials, reports } = install() const page = new AbortController() diff --git a/src/renderer/src/components/editor/rich-markdown/schema/rich-markdown-prose-entities.test.ts b/src/renderer/src/components/editor/rich-markdown/schema/rich-markdown-prose-entities.test.ts index fd134eb7771..5eb52655678 100644 --- a/src/renderer/src/components/editor/rich-markdown/schema/rich-markdown-prose-entities.test.ts +++ b/src/renderer/src/components/editor/rich-markdown/schema/rich-markdown-prose-entities.test.ts @@ -1,17 +1,14 @@ import { Editor, type JSONContent } from '@tiptap/core' import { describe, expect, it } from 'vitest' import { createRichMarkdownEditorCodec } from '../document/rich-markdown-source-transport' -import { encodeRawMarkdownHtmlForRichEditor } from '../raw-source/raw-markdown-html' import { createRichMarkdownExtensions } from './rich-markdown-extensions' -function createEditor(content: JSONContent | string): Editor { +function createEditor(content: JSONContent): Editor { const codec = createRichMarkdownEditorCodec() return new Editor({ element: null, extensions: createRichMarkdownExtensions({ codec }), - content: - typeof content === 'string' ? encodeRawMarkdownHtmlForRichEditor(content, codec) : content, - ...(typeof content === 'string' ? { contentType: 'markdown' as const } : {}) + content }) } @@ -37,20 +34,6 @@ describe('typed prose entities', () => { } }) - it.each(['a < b && c, F&B > R, © & ', '> quote', 'x'])( - 'reopens %j unchanged', - (text) => { - const editor = createEditor(paragraph(text)) - const reopened = createEditor(editor.getMarkdown()) - try { - expect(reopened.getJSON()).toEqual(editor.getJSON()) - } finally { - editor.destroy() - reopened.destroy() - } - } - ) - it('leaves entity text inside a code span alone', () => { const editor = createEditor(paragraph('& > x', [{ type: 'code' }])) try { diff --git a/src/renderer/src/components/native-chat/messages/rows/NativeChatMessageRow.test.tsx b/src/renderer/src/components/native-chat/messages/rows/NativeChatMessageRow.test.tsx deleted file mode 100644 index 630085698e6..00000000000 --- a/src/renderer/src/components/native-chat/messages/rows/NativeChatMessageRow.test.tsx +++ /dev/null @@ -1,63 +0,0 @@ -// @vitest-environment happy-dom - -import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { TooltipProvider } from '@/components/ui/tooltip' -import { MessageRow } from './NativeChatMessageRow' - -afterEach(cleanup) - -describe('MessageRow sent image prompt markers', () => { - it('draws and copies a user message without the [Image #N] its send wrote mid-sentence', async () => { - const writeClipboardText = vi.fn().mockResolvedValue(undefined) - Object.assign(window, { api: { ui: { writeClipboardText } } }) - - render( - - - - ) - expect(screen.getByText('[Image #1]').tagName).toBe('CODE') - expect(screen.getByText(/Compare this\s+with/)).toBeTruthy() - fireEvent.click(screen.getByRole('button', { name: 'Copy message' })) - await waitFor(() => { - expect(writeClipboardText).toHaveBeenCalledWith('Compare this with `[Image #1]`') - }) - }) - - it('omits the copy button when a user message has only its sent [Image #1] marker and image', () => { - render( - - - - ) - expect(screen.queryByText(/\[Image #1\]/)).toBeNull() - expect(screen.queryByRole('button', { name: 'Copy message' })).toBeNull() - }) -})