diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json index 9ee44607b1a..1287d2a7ca9 100644 --- a/config/scripts/ci/sharding/ci-shard-timings.json +++ b/config/scripts/ci/sharding/ci-shard-timings.json @@ -296,7 +296,6 @@ "config/scripts/ci/workflow-contracts/zcode-credential-workflow.test.mjs": 668, "config/scripts/archives/platform-command/zip-extractor-command.test.mjs": 74, "src/cli/account-add-process.test.ts": 33700, - "src/cli/agent-context.test.ts": 142, "src/cli/agent-launch-process.test.ts": 2348, "src/cli/agent-session-search-format.test.ts": 84, "src/cli/args-repeatable-flags.test.ts": 67, @@ -312,7 +311,6 @@ "src/cli/computer-tree-query.test.ts": 79, "src/cli/format-recovery.test.ts": 413, "src/cli/format.test.ts": 446, - "src/cli/handler-group-manifest.test.ts": 3610, "src/cli/handlers/account.test.ts": 849, "src/cli/handlers/agent-hooks.test.ts": 1702, "src/cli/handlers/artifacts.test.ts": 471, @@ -443,10 +441,7 @@ "src/cli/skills.test.ts": 386, "src/cli/specs/account.test.ts": 95, "src/cli/specs/cli-command-names-parity.test.ts": 205, - "src/cli/specs/profile-state.test.ts": 102, "src/cli/terminal-read-screen.test.ts": 660, - "src/cli/worktree-ps-program-status.test.ts": 65, - "src/cli/worktree-ps-terminal-verdict.test.ts": 60, "src/cli/worktree-selector-caller-host.test.ts": 107, "src/cli/worktree-selector-wsl-posix-path.test.ts": 134, "src/main/acp/process/acp-agent-connection.test.ts": 407, @@ -3986,7 +3981,6 @@ "src/main/startup/serve-user-data-path-guard.test.ts": 198, "src/main/startup/single-instance-lock-exit.electron.test.ts": 551, "src/main/startup/skill-share-deep-link-state.test.ts": 217, - "src/main/startup/startup-diagnostics.test.ts": 39, "src/main/startup/windows-app-data-path.test.ts": 55, "src/main/startup/windows-install-dir-acl-recovery.test.ts": 614, "src/main/startup/windows-install-dir-acl-repair.win32.test.ts": 132, @@ -4006,17 +4000,13 @@ "src/main/power/system-power-lifecycle.test.ts": 42, "src/main/power/system-resume-broadcast.test.ts": 67, "src/main/telemetry/burst-cap.test.ts": 177, - "src/main/telemetry/classify-error.test.ts": 43, "src/main/telemetry/client-agent-dashboard-snapshot.test.ts": 201, "src/main/telemetry/client-deferred-start.test.ts": 8659, "src/main/telemetry/client-lifecycle.test.ts": 206, "src/main/telemetry/client.test.ts": 213, "src/main/telemetry/consent.test.ts": 48, - "src/main/telemetry/onboarding-feature-setup-validator.test.ts": 182, "src/main/telemetry/plugin-install-telemetry.test.ts": 282, "src/main/telemetry/posthog-transport-main-http-client.test.ts": 123, - "src/main/telemetry/validator-warn-cache.test.ts": 187, - "src/main/telemetry/validator.test.ts": 170, "src/main/telemetry/wsl-usage-reporter.test.ts": 407, "src/main/pty/history/terminal-history-gc-fs-call-count.test.ts": 157, "src/main/pty/history/terminal-history-gc.test.ts": 824, @@ -4107,7 +4097,6 @@ "src/main/window/mac-app-paste-input.test.ts": 85, "src/main/window/macos-app-activation.test.ts": 44, "src/main/window/macos-desktop-handoff.test.ts": 60, - "src/main/window/macos-tahoe-release.test.ts": 48, "src/main/window/main-window-state-lifecycle.test.ts": 60, "src/main/window/main-window-updater-deferred-setup.test.ts": 215, "src/main/window/native-chat-paste-files.test.ts": 666, @@ -4126,7 +4115,6 @@ "src/main/window/terminal-pane-reveal-relay.test.ts": 91, "src/main/window/terminal-tab-close-request-relay.test.ts": 64, "src/main/window/updater-package-recovery-ipc.test.ts": 169, - "src/main/window/window-close-decision.test.ts": 39, "src/main/pty/process-retirement/windows-live-tree-kill.win32.test.ts": 76, "src/main/pty/process-retirement/windows-pty-root-identity.test.ts": 135, "src/main/windows/windows-registry-addon.test.ts": 39, @@ -4333,7 +4321,6 @@ "src/renderer/src/components/activity/activity-thread-list-pane.virtualization.test.tsx": 4863, "src/renderer/src/components/activity/useActivityUnreadCount.freshness.test.tsx": 1990, "src/renderer/src/components/activity/useActivityUnreadCount.test.ts": 1633, - "src/renderer/src/components/agent-session-continuation/agent-session-continuation-selection.test.ts": 56, "src/renderer/src/components/agent-tab-shortcut-launch.test.ts": 369, "src/renderer/src/components/agent/AgentLaunchPickerMenu.search.test.tsx": 2090, "src/renderer/src/components/artifacts/ArtifactCollection.test.tsx": 1833, @@ -5531,7 +5518,6 @@ "src/renderer/src/components/terminal/terminal-tab-actions-unrouted-close.test.ts": 589, "src/renderer/src/components/terminal/terminal-tab-actions.test.ts": 626, "src/renderer/src/components/terminal/terminal-tab-close-running-confirm.test.ts": 499, - "src/renderer/src/components/terminal/unsaved-close-queue.test.ts": 42, "src/renderer/src/components/terminal/use-terminal-provider-snapshot-capability.test.tsx": 573, "src/renderer/src/components/terminal/window-close-running-work.test.ts": 97, "src/renderer/src/components/ui/menu-pointer-highlight.test.tsx": 350, @@ -6531,7 +6517,6 @@ "src/shared/linux-wayland-session.test.ts": 46, "src/shared/local-build-compatibility.test.ts": 46, "src/shared/local-windows-terminal-runtime.test.ts": 41, - "src/shared/localhost-worktree-labels.test.ts": 41, "src/shared/loose-ref-count.test.ts": 140, "src/shared/macos-symbolic-hotkeys.test.ts": 95, "src/shared/managed-agent-command-token.test.ts": 45, @@ -6599,7 +6584,6 @@ "src/shared/native-chat/tools/native-chat-tool-attribution-allocation.test.ts": 105, "src/shared/native-chat/tools/native-chat-tool-identity.test.ts": 73, "src/shared/native-chat/tools/native-chat-tool-line-identity.test.ts": 50, - "src/shared/native-chat/tools/native-chat-tool-line-label.test.ts": 259, "src/shared/native-chat/tools/native-chat-tool-pairing.performance.test.ts": 235, "src/shared/native-chat/tools/native-chat-tool-preview-prefix.test.ts": 46, "src/shared/native-chat/tools/native-chat-tool-run-outcome.test.ts": 68, diff --git a/src/cli/agent-context.test.ts b/src/cli/agent-context.test.ts deleted file mode 100644 index 4ea6cea1055..00000000000 --- a/src/cli/agent-context.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, expect, it } from 'vitest' - -import type { CommandSpec } from './args' -import { buildAgentContext } from './agent-context' -import { COMMAND_SPECS } from './specs' - -describe('buildAgentContext', () => { - const specs: CommandSpec[] = [ - { - path: ['worktree', 'rm'], - aliases: [ - ['worktree', 'remove'], - ['worktree', 'delete'] - ], - summary: 'Remove a worktree', - usage: 'orca worktree rm', - allowedFlags: ['worktree', 'force'] - }, - { - path: ['agent-context'], - summary: 'Print the schema', - usage: 'orca agent-context', - allowedFlags: [] - } - ] - - it('reports effective flags including globals, not just allowedFlags', () => { - const schema = buildAgentContext(specs) - const rm = schema.commands.find((command) => command.command === 'worktree rm') - expect(rm?.flags).toContain('worktree') - expect(rm?.flags).toContain('force') - expect(rm?.flags).toContain('json') - expect(rm?.flags).toContain('help') - }) - - it('omits hidden specs so agents do not discover an unadvertised command', () => { - const schema = buildAgentContext([ - ...specs, - { - path: ['terminal', 'stop'], - summary: 'Deprecated', - usage: 'orca terminal stop', - allowedFlags: [], - hidden: true - } - ]) - expect(schema.commandCount).toBe(2) - expect(schema.commands.map((command) => command.command)).not.toContain('terminal stop') - }) -}) - -describe('agent-context over the live registry', () => { - it('marks raw passthrough commands without synthesizing Orca flags', () => { - const schema = buildAgentContext(COMMAND_SPECS) - const claudeTeams = schema.commands.find((command) => command.command === 'claude-teams') - expect(claudeTeams?.argumentMode).toBe('passthrough') - expect(claudeTeams?.flags).toEqual([]) - }) -}) diff --git a/src/cli/dispatch.ts b/src/cli/dispatch.ts index b6fb322420b..47373b0e7b4 100644 --- a/src/cli/dispatch.ts +++ b/src/cli/dispatch.ts @@ -49,5 +49,3 @@ export async function dispatch(commandPath: string[], ctx: HandlerContext): Prom } await handler(ctx) } - -export { buildRoutes as buildHandlerRoutes } diff --git a/src/cli/handler-group-manifest.test.ts b/src/cli/handler-group-manifest.test.ts deleted file mode 100644 index e39bc7a9b21..00000000000 --- a/src/cli/handler-group-manifest.test.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { describe, expect, it } from 'vitest' - -import { buildHandlerRoutes } from './dispatch' -import type { HandlerGroup } from './handler-group-manifest' - -describe('duplicate command keys', () => { - const group = (name: string, keys: string[]): HandlerGroup => ({ - name, - keys, - load: async () => ({}) - }) - - it('rejects the same key claimed by two groups', () => { - expect(() => - buildHandlerRoutes([group('alpha', ['ship it']), group('beta', ['ship it'])]) - ).toThrow('Duplicate CLI handler registration for "ship it" (alpha and beta)') - }) - - it('rejects a key duplicated inside one group list', () => { - expect(() => buildHandlerRoutes([group('alpha', ['ship it', 'ship it'])])).toThrow( - 'Duplicate CLI handler registration for "ship it"' - ) - }) -}) diff --git a/src/cli/handler-group-manifest.ts b/src/cli/handler-group-manifest.ts index 83a35a06b45..c95a0bec902 100644 --- a/src/cli/handler-group-manifest.ts +++ b/src/cli/handler-group-manifest.ts @@ -15,7 +15,6 @@ export type HandlerGroup = { load: () => Promise> } -// handler-group-manifest.test.ts checks keys against the real exports to prevent drift. export const HANDLER_GROUPS: readonly HandlerGroup[] = [ JIRA_HANDLER_GROUP, LINEAR_HANDLER_GROUP, diff --git a/src/cli/specs/profile-state.test.ts b/src/cli/specs/profile-state.test.ts deleted file mode 100644 index e7f3982d748..00000000000 --- a/src/cli/specs/profile-state.test.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { parseArgs, validateCommandAndFlags } from '../args' -import { PROFILE_STATE_COMMAND_SPECS } from './profile-state' - -describe('profile state rollback discovery', () => { - it.each( - ['current-json', 'latest-json'].flatMap((selector) => [ - { selector, argv: ['profile', 'state', 'rollback', `--${selector}`] }, - { selector, argv: [`--${selector}`, 'profile', 'state', 'rollback'] }, - { selector, argv: ['profile', `--${selector}`, 'state', 'rollback'] } - ]) - )('parses the JSON selector as a boolean: $argv', ({ argv, selector }) => { - const parsed = parseArgs(argv) - expect(parsed.commandPath).toEqual(['profile', 'state', 'rollback']) - expect(parsed.flags.get(selector)).toBe(true) - expect(() => validateCommandAndFlags(PROFILE_STATE_COMMAND_SPECS, parsed)).not.toThrow() - }) - - it('parses the current SQLite selector as a boolean', () => { - const parsed = parseArgs(['profile', 'state', 'rollback', '--current-sqlite']) - expect(parsed.flags.get('current-sqlite')).toBe(true) - expect(() => validateCommandAndFlags(PROFILE_STATE_COMMAND_SPECS, parsed)).not.toThrow() - }) -}) diff --git a/src/cli/worktree-ps-program-status.test.ts b/src/cli/worktree-ps-program-status.test.ts deleted file mode 100644 index 891de11ca69..00000000000 --- a/src/cli/worktree-ps-program-status.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { RuntimeWorktreeAgentRow } from '../shared/runtime-types' -import { formatWorktreePsProgramStatus } from './worktree-ps-program-status' - -function agent(over: Partial): RuntimeWorktreeAgentRow { - return { - paneKey: 'tab:leaf', - parentPaneKey: null, - state: 'working', - agentType: 'codex', - prompt: 'ship it', - taskTitle: null, - displayName: null, - lastAssistantMessage: null, - toolName: null, - toolInput: null, - interrupted: false, - stateStartedAt: 1, - updatedAt: 1, - ...over - } -} - -describe('formatWorktreePsProgramStatus', () => { - it('prefers a reported block over another agent progress', () => { - const working = agent({ programStatus: { state: 'working', progress: 42, observedAt: 1 } }) - const signIn = agent({ - paneKey: 'tab:leaf-2', - state: 'done', - programStatus: { state: 'blocked', kind: 'auth', observedAt: 1 } - }) - expect(formatWorktreePsProgramStatus([working, signIn])).toBe(' (Sign-in required)') - }) - - it('hides progress on a finished row', () => { - const programStatus = { state: 'working' as const, progress: 42, observedAt: 1 } - expect(formatWorktreePsProgramStatus([agent({ state: 'done', programStatus })])).toBe('') - }) -}) diff --git a/src/cli/worktree-ps-terminal-verdict.test.ts b/src/cli/worktree-ps-terminal-verdict.test.ts deleted file mode 100644 index 9809e8a0e9f..00000000000 --- a/src/cli/worktree-ps-terminal-verdict.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - formatWorktreePsTerminalFields, - projectWorktreePsTerminalVerdict -} from './worktree-ps-terminal-verdict' - -describe('worktree ps terminal verdict', () => { - it('prints unverifiable, never zero or no, for an unreachable host', () => { - const row = { liveTerminalCount: 0, hasAttachedPty: false, unverifiableTerminalCount: 1 } - expect(formatWorktreePsTerminalFields(row)).toBe('live:unverifiable pty:unverifiable') - expect(projectWorktreePsTerminalVerdict(row), 'count fields keep their JSON types').toEqual({ - ...row, - terminalVerdict: 'unverifiable' - }) - }) - - it('keeps verified terminals alongside unverifiable ones', () => { - const row = { liveTerminalCount: 1, hasAttachedPty: true, unverifiableTerminalCount: 2 } - expect(formatWorktreePsTerminalFields(row)).toBe('live:1+2 unverifiable pty:yes') - expect( - formatWorktreePsTerminalFields({ ...row, hasAttachedPty: false }), - 'an unverifiable terminal may hold the pty' - ).toBe('live:1+2 unverifiable pty:unverifiable') - expect(projectWorktreePsTerminalVerdict(row)).toEqual({ ...row, terminalVerdict: 'live' }) - }) - - it('reports unverifiable for an idle row from a host that predates the count', () => { - const row = { liveTerminalCount: 0, hasAttachedPty: false } - expect(formatWorktreePsTerminalFields(row)).toBe('live:unverifiable pty:unverifiable') - expect(projectWorktreePsTerminalVerdict(row)).toEqual({ - ...row, - terminalVerdict: 'unverifiable' - }) - }) -}) diff --git a/src/main/rate-limits/providers/opencode-go/opencode-go-status-parsing.test.ts b/src/main/rate-limits/providers/opencode-go/opencode-go-status-parsing.test.ts deleted file mode 100644 index dbfb15f8037..00000000000 --- a/src/main/rate-limits/providers/opencode-go/opencode-go-status-parsing.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { parseOpenCodeGoBillingStatusPayload } from './opencode-go-status-parsing' - -describe('parseOpenCodeGoBillingStatusPayload', () => { - it('maps the verified PAYG micro-cent string into USD major units', () => { - expect( - parseOpenCodeGoBillingStatusPayload( - JSON.stringify({ - billingMode: 'prepaid', - mode: 'pay-as-you-go', - balanceMicroCents: '2786781005' - }) - ) - ).toBe(27.86781005) - }) -}) diff --git a/src/main/startup/startup-diagnostics.test.ts b/src/main/startup/startup-diagnostics.test.ts deleted file mode 100644 index 411eb058c1b..00000000000 --- a/src/main/startup/startup-diagnostics.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { afterEach, expect, it, vi } from 'vitest' -import { logStartupMilestone, STARTUP_DIAGNOSTICS_ENV } from './startup-diagnostics' - -afterEach(() => vi.unstubAllEnvs()) - -it('does not compute lazy milestone details unless diagnostics are enabled', () => { - vi.stubEnv(STARTUP_DIAGNOSTICS_ENV, '0') - const details = vi.fn(() => ({ bytes: 123 })) - logStartupMilestone('persistence-load-done', details) - expect(details).not.toHaveBeenCalled() - vi.stubEnv(STARTUP_DIAGNOSTICS_ENV, '1') - logStartupMilestone('persistence-load-done', details) - expect(details).toHaveBeenCalledOnce() -}) diff --git a/src/main/telemetry/classify-error.test.ts b/src/main/telemetry/classify-error.test.ts deleted file mode 100644 index 0233d6b85fa..00000000000 --- a/src/main/telemetry/classify-error.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { describe, it, expect } from 'vitest' -import { classifyError } from './classify-error' - -describe('classifyError', () => { - it('classifies ENOENT as binary_not_found', () => { - expect(classifyError(new Error('spawn zsh ENOENT'))).toEqual({ - error_class: 'binary_not_found' - }) - expect(classifyError(Object.assign(new Error('missing'), { code: 'ENOENT' }))).toEqual({ - error_class: 'binary_not_found' - }) - }) - - it('keeps shell-output-shaped not-found messages unknown', () => { - expect(classifyError(new Error('command not found: claude'))).toEqual({ - error_class: 'unknown' - }) - expect(classifyError(new Error('workspace not found'))).toEqual({ - error_class: 'unknown' - }) - expect( - classifyError( - Object.assign(new Error('socket missing'), { code: 'ENOENT', syscall: 'connect' }) - ) - ).toEqual({ error_class: 'unknown' }) - }) -}) diff --git a/src/main/telemetry/onboarding-feature-setup-validator.test.ts b/src/main/telemetry/onboarding-feature-setup-validator.test.ts deleted file mode 100644 index a41a0345936..00000000000 --- a/src/main/telemetry/onboarding-feature-setup-validator.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { _resetValidatorWarnCacheForTests, validate } from './validator' - -describe('onboarding feature setup telemetry validation', () => { - beforeEach(() => { - _resetValidatorWarnCacheForTests() - vi.spyOn(console, 'warn').mockImplementation(() => {}) - }) - - afterEach(() => { - vi.restoreAllMocks() - }) - - it('accepts checklist and setup run events', () => { - const selection = { - browser_use: true, - computer_use: false, - linear_tickets: true, - orchestration: true, - selected_count: 2 - } - const cases = [ - ['onboarding_feature_setup_toggled', { feature: 'browser_use', selected: false }], - [ - 'onboarding_feature_setup_run', - { - ...selection, - cli_touched: true, - skill_install_result: 'needs_attention', - computer_use_permissions_opened: false, - warning_count: 0 - } - ] - ] as const - - for (const [event, props] of cases) { - expect(validate(event, props).ok).toBe(true) - } - }) - - it('rejects selected_count values that do not match selected features', () => { - expect( - validate('onboarding_feature_setup_run', { - browser_use: false, - computer_use: false, - linear_tickets: false, - orchestration: false, - selected_count: 3, - cli_touched: false, - skill_install_result: 'installed', - computer_use_permissions_opened: false, - warning_count: 0 - }).ok - ).toBe(false) - }) -}) diff --git a/src/main/telemetry/validator-warn-cache.test.ts b/src/main/telemetry/validator-warn-cache.test.ts deleted file mode 100644 index 2bc1cbcd76f..00000000000 --- a/src/main/telemetry/validator-warn-cache.test.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { - _getValidatorWarnCacheSizeForTests, - _resetValidatorWarnCacheForTests, - validate -} from './validator' - -describe('telemetry validator warn cache', () => { - beforeEach(() => { - _resetValidatorWarnCacheForTests() - vi.spyOn(console, 'warn').mockImplementation(() => {}) - }) - - afterEach(() => { - vi.restoreAllMocks() - }) - - it('bounds warn rate-limit entries for unique invalid event names', () => { - for (let i = 0; i < 300; i++) { - validate(`not_a_real_event_${i}` as never, {}) - } - - expect(_getValidatorWarnCacheSizeForTests()).toBeLessThanOrEqual(256) - }) - - it('prunes expired warn rate-limit entries', () => { - vi.spyOn(Date, 'now').mockReturnValue(0) - validate('not_a_real_event' as never, {}) - - expect(_getValidatorWarnCacheSizeForTests()).toBe(1) - - vi.spyOn(Date, 'now').mockReturnValue(60_000) - validate('another_fake_event' as never, {}) - - expect(_getValidatorWarnCacheSizeForTests()).toBe(1) - }) -}) diff --git a/src/main/telemetry/validator.test.ts b/src/main/telemetry/validator.test.ts deleted file mode 100644 index a5ac7aeb9dd..00000000000 --- a/src/main/telemetry/validator.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { _resetValidatorWarnCacheForTests, validate } from './validator' - -describe('validate', () => { - beforeEach(() => { - _resetValidatorWarnCacheForTests() - vi.spyOn(console, 'warn').mockImplementation(() => {}) - }) - afterEach(() => { - vi.restoreAllMocks() - }) - - it('drops unknown event names', () => { - const result = validate('not_a_real_event' as never, {}) - expect(result.ok).toBe(false) - if (!result.ok) { - expect(result.reason).toMatch(/unknown event/) - } - }) -}) diff --git a/src/main/telemetry/validator.ts b/src/main/telemetry/validator.ts index c4494728b07..a9ac83906b8 100644 --- a/src/main/telemetry/validator.ts +++ b/src/main/telemetry/validator.ts @@ -66,13 +66,5 @@ export function validate(name: N, props: unknown): Validati return { ok: true, props: parsed.data as EventProps } } -export function _resetValidatorWarnCacheForTests(): void { - lastWarnAt.clear() -} - -export function _getValidatorWarnCacheSizeForTests(): number { - return lastWarnAt.size -} - // Keep outgoing common-property revalidation behind the same validator surface. export { commonPropsSchema } diff --git a/src/main/window/macos-tahoe-release.test.ts b/src/main/window/macos-tahoe-release.test.ts deleted file mode 100644 index 78aa7b2dd58..00000000000 --- a/src/main/window/macos-tahoe-release.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { isMacosTahoeOrNewer } from './macos-tahoe-release' - -describe('isMacosTahoeOrNewer', () => { - it('detects Darwin 25+ (macOS 26) as Tahoe or newer', () => { - expect(isMacosTahoeOrNewer('25.5.0')).toBe(true) - expect(isMacosTahoeOrNewer('26.0.0')).toBe(true) - }) - - it('treats older Darwin releases as pre-Tahoe', () => { - expect(isMacosTahoeOrNewer('24.6.0')).toBe(false) - expect(isMacosTahoeOrNewer('23.0.0')).toBe(false) - }) - - it('treats unparseable releases as pre-Tahoe', () => { - expect(isMacosTahoeOrNewer('')).toBe(false) - expect(isMacosTahoeOrNewer('unknown')).toBe(false) - }) -}) diff --git a/src/main/window/window-close-decision.test.ts b/src/main/window/window-close-decision.test.ts deleted file mode 100644 index 1ecf2da3dd6..00000000000 --- a/src/main/window/window-close-decision.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { resolveWindowCloseAction } from './window-close-decision' - -describe('resolveWindowCloseAction', () => { - it('bypasses confirmation only when the renderer is truly gone or crashed', () => { - expect( - resolveWindowCloseAction({ - windowCloseConfirmed: false, - rendererProcessGone: true, - isRendererCrashed: false - }) - ).toBe('bypass-gone') - expect( - resolveWindowCloseAction({ - windowCloseConfirmed: false, - rendererProcessGone: false, - isRendererCrashed: true - }) - ).toBe('bypass-gone') - }) - - // #5787: hung-but-live renderers still need save/process confirmation; only proven gone/crashed renderers may bypass. - it('requests confirmation for an alive renderer (no gone/crashed flag)', () => { - expect( - resolveWindowCloseAction({ - windowCloseConfirmed: false, - rendererProcessGone: false, - isRendererCrashed: false - }) - ).toBe('request-confirmation') - }) -}) diff --git a/src/renderer/src/components/agent-session-continuation/agent-session-continuation-selection.test.ts b/src/renderer/src/components/agent-session-continuation/agent-session-continuation-selection.test.ts deleted file mode 100644 index 7a551b746af..00000000000 --- a/src/renderer/src/components/agent-session-continuation/agent-session-continuation-selection.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { expect, it } from 'vitest' -import { chooseInitialContinuationAgent } from './agent-session-continuation-selection' - -it('does not automatically choose an offered-only chat, but preserves source and default intent', () => { - const pick = (sourceAgent: 'antigravity' | null, defaultAgent: unknown) => - chooseInitialContinuationAgent({ - availableAgents: ['antigravity'], - automaticAgents: [], - sourceAgent, - defaultAgent - }) - expect(pick(null, null)).toBeNull() - expect(pick('antigravity', null)).toBe('antigravity') - expect(pick(null, 'antigravity')).toBe('antigravity') -}) diff --git a/src/renderer/src/components/terminal/unsaved-close-queue.test.ts b/src/renderer/src/components/terminal/unsaved-close-queue.test.ts deleted file mode 100644 index 75ec34e5a16..00000000000 --- a/src/renderer/src/components/terminal/unsaved-close-queue.test.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { appendUniqueOpenFileIds } from './unsaved-close-queue' - -describe('appendUniqueOpenFileIds', () => { - it('appends only open file ids and skips duplicates', () => { - const result = appendUniqueOpenFileIds( - ['a'], - ['a', 'b', 'missing', 'c', 'b'], - new Set(['a', 'b', 'c']) - ) - expect(result).toEqual(['a', 'b', 'c']) - }) -}) diff --git a/src/shared/localhost-worktree-labels.test.ts b/src/shared/localhost-worktree-labels.test.ts deleted file mode 100644 index cf8c7e2c08f..00000000000 --- a/src/shared/localhost-worktree-labels.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { getLocalhostWorktreeRouteKey } from './localhost-worktree-labels' - -describe('localhost worktree labels', () => { - it('keeps route keys unique for different ports in the same worktree', () => { - const route = { - projectName: 'Snap Studio', - worktreeName: 'analytics', - repoId: 'repo-1', - worktreeId: 'wt-analytics' - } - - expect( - getLocalhostWorktreeRouteKey({ - ...route, - targetUrl: 'http://localhost:5173/' - }) - ).not.toBe( - getLocalhostWorktreeRouteKey({ - ...route, - targetUrl: 'http://localhost:7777/' - }) - ) - }) -}) diff --git a/src/shared/native-chat/tools/native-chat-tool-line-label.test.ts b/src/shared/native-chat/tools/native-chat-tool-line-label.test.ts deleted file mode 100644 index d21de3d6dec..00000000000 --- a/src/shared/native-chat/tools/native-chat-tool-line-label.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { nativeChatToolLineLabel } from './native-chat-tool-line-label' - -describe('nativeChatToolLineLabel', () => { - it('names a Codex change to several files by its count, and offers no file to open', () => { - const label = nativeChatToolLineLabel( - { type: 'tool-call', name: 'Diff', input: { path: '2 files' }, state: 'completed' }, - { type: 'tool-result', output: '@@ -1 +1 @@\n-a\n+b' } - ) - expect(label).toMatchObject({ verb: 'edited', target: '2 files', filePath: null }) - }) - - it('still links a real file whose name reads like a count', () => { - const label = nativeChatToolLineLabel({ - type: 'tool-call', - name: 'Read', - input: { file_path: '2 files' }, - state: 'completed' - }) - expect(label.filePath).toBe('2 files') - }) - - it('links a read, never a listed folder', () => { - const read = nativeChatToolLineLabel({ - type: 'tool-call', - name: 'Read', - input: { file_path: 'src/a.ts' }, - state: 'completed' - }) - const list = nativeChatToolLineLabel({ - type: 'tool-call', - name: 'list', - input: { command: 'ls src', path: 'src' }, - state: 'completed' - }) - expect(read).toMatchObject({ verb: 'read', target: 'a.ts', filePath: 'src/a.ts' }) - expect(list).toMatchObject({ verb: 'listed', filePath: null }) - }) -})