Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

test: remove low-value wrapper, copy, and theme checks (#36202)

OrcaWin76799163421b
diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc
index 3651eb8e150..574b3e5de0d 100644
--- a/config/reliability-gates.jsonc
+++ b/config/reliability-gates.jsonc
@@ -10841,7 +10841,7 @@
"invariant": "Only an explicit user change in Settings > Remote Orca Servers > Advanced > Active Server may mutate activeRuntimeEnvironmentId. Connecting, pairing, disconnecting, selecting or revealing a workspace or terminal, browser/mobile handoff, remote navigation, and reconnect must use transient or target-owner routing and must never rewrite the durable preference. Every Add Project selected host must satisfy canSelectAddRepoHost; paired web has no local filesystem fallback, so no valid host means Browse, Clone, and Create remain disabled. Every operation stays on the host selected when it began, even if preference or catalog state changes. Generic settings mutation cannot bypass the dedicated preference IPC.",
"oracle": "Start with Active Server=Local desktop, connect and navigate Windows 2, then reveal a local terminal and assert it succeeds while the persisted preference remains local before and after restart. Repeat transient routing and selected-runtime Add Project operations with exact-ID host decoys and completion reordering. Separately pair the real web client to an isolated headed host, then make its sole still-listed runtime compatibility-blocked and unavailable. Require a null authoritative selection, a disabled host option, and disabled Browse, Clone, and Create actions with no local fallback. Repeat against headless serve. Run the byte-identical selector/action contract on latest main, candidate, and candidate with the eligibility seam disabled.",
"commands": [
- "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/settings.test.ts src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts src/renderer/src/store/slices/settings.test.ts src/renderer/src/store/slices/browser.test.ts src/renderer/src/components/settings/browser-session-host-selection.test.ts src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts src/renderer/src/components/status-bar/SshStatusSegment.test.ts src/renderer/src/components/sidebar/use-add-repo-host-selection.test.ts src/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.ts src/renderer/src/web/web-preload-api-runtime-environment.test.ts --maxWorkers=1",
+ "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/settings.test.ts src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts src/renderer/src/store/slices/settings.test.ts src/renderer/src/store/slices/browser.test.ts src/renderer/src/components/settings/browser-session-host-selection.test.ts src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts src/renderer/src/components/sidebar/use-add-repo-host-selection.test.ts src/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.ts src/renderer/src/web/web-preload-api-runtime-environment.test.ts --maxWorkers=1",
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/sidebar/AddProjectFromFolderDialog.test.tsx src/renderer/src/components/sidebar/NonGitFolderDialog.test.tsx src/renderer/src/components/sidebar/AddRepoDialog.default-checkout.test.ts src/renderer/src/components/sidebar/AddRepoSteps.default-checkout.test.ts src/renderer/src/components/sidebar/project-added-default-checkout.test.ts src/renderer/src/components/sidebar/useAddRepoLocalFolderFlow.test.ts src/renderer/src/components/sidebar/useAddRepoNestedImportFlow.test.ts src/renderer/src/components/sidebar/useAddRepoServerPathFlow.test.ts src/renderer/src/components/sidebar/useAddRepoCloneFlow.test.ts src/renderer/src/components/sidebar/useCreateRepo.default-checkout.test.ts src/renderer/src/components/sidebar/worktree-list/listing/host-filtering.test.ts src/renderer/src/lib/resolved-worktree-execution-host.test.ts src/renderer/src/lib/worktree-runtime-owner.test.ts src/renderer/src/store/selectors.test.ts src/renderer/src/store/slices/repos-catalog-reconciliation.test.ts src/renderer/src/store/slices/repos-project-groups.test.ts src/renderer/src/store/slices/repos-selected-owner-routing.test.ts src/renderer/src/store/slices/selected-host-active-workspace-identity.test.ts src/renderer/src/store/slices/worktrees-fetch-owner-routing.test.ts --maxWorkers=1",
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/sidebar/use-add-repo-host-selection.test.ts src/renderer/src/components/sidebar/add-repo-browse-authority.test.ts src/renderer/src/components/sidebar/AddRepoDialogStepContent.test.tsx src/renderer/src/components/sidebar/AddRepoStartSteps.test.tsx src/renderer/src/components/sidebar/useAddRepoServerPathFlow.test.ts src/renderer/src/store/slices/repos-paired-runtime-add.test.ts --maxWorkers=1",
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/sidebar/AddProjectFromFolderDialog.test.tsx src/renderer/src/components/sidebar/NonGitFolderDialog.test.tsx src/renderer/src/components/sidebar/AddRepoDialog.default-checkout.test.ts src/renderer/src/components/sidebar/AddRepoSteps.default-checkout.test.ts src/renderer/src/components/sidebar/project-added-default-checkout.test.ts src/renderer/src/components/sidebar/useAddRepoLocalFolderFlow.test.ts src/renderer/src/components/sidebar/useAddRepoNestedImportFlow.test.ts src/renderer/src/components/sidebar/useAddRepoServerPathFlow.test.ts src/renderer/src/components/sidebar/useAddRepoCloneFlow.test.ts src/renderer/src/components/sidebar/useCreateRepo.default-checkout.test.ts src/renderer/src/components/sidebar/worktree-list/listing/host-filtering.test.ts src/renderer/src/lib/resolved-worktree-execution-host.test.ts src/renderer/src/lib/worktree-runtime-owner.test.ts src/renderer/src/store/selectors.test.ts src/renderer/src/store/slices/repos-catalog-reconciliation.test.ts src/renderer/src/store/slices/repos-project-groups.test.ts src/renderer/src/store/slices/repos-selected-owner-routing.test.ts src/renderer/src/store/slices/selected-host-active-workspace-identity.test.ts src/renderer/src/store/slices/worktrees-fetch-owner-routing.test.ts src/renderer/src/runtime/web-runtime-session.test.ts --maxWorkers=1",
@@ -10857,7 +10857,6 @@
"src/renderer/src/store/slices/browser.test.ts",
"src/renderer/src/components/settings/browser-session-host-selection.test.ts",
"src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts",
- "src/renderer/src/components/status-bar/SshStatusSegment.test.ts",
"src/renderer/src/components/sidebar/use-add-repo-host-selection.test.ts",
"src/renderer/src/components/sidebar/add-repo-browse-authority.test.ts",
"src/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.ts",
@@ -11059,6 +11058,7 @@
"runner": "local",
"platform": "macos",
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/settings.test.ts src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts src/renderer/src/store/slices/settings.test.ts src/renderer/src/store/slices/browser.test.ts src/renderer/src/components/settings/browser-session-host-selection.test.ts src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts src/renderer/src/components/status-bar/SshStatusSegment.test.ts src/renderer/src/components/sidebar/use-add-repo-host-selection.test.ts src/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.ts src/renderer/src/web/web-preload-api-runtime-environment.test.ts --maxWorkers=1",
+ "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/settings.test.ts src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts src/renderer/src/store/slices/settings.test.ts src/renderer/src/store/slices/browser.test.ts src/renderer/src/components/settings/browser-session-host-selection.test.ts src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts src/renderer/src/components/sidebar/use-add-repo-host-selection.test.ts src/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.ts src/renderer/src/web/web-preload-api-runtime-environment.test.ts --maxWorkers=1",
"result": "passed",
"durationSeconds": 6.55,
"summary": "Ten files and 282 tests passed, including the composed Local -> Windows 2 navigation -> local reveal -> restart regression, dedicated-only preference persistence, removed transient-host fallback, multi-client browser routing, late host-operation suppression, and web pairing/preference separation."
diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json
index 391a825ed05..7a4ac0e2789 100644
--- a/config/scripts/ci-shard-timings.json
+++ b/config/scripts/ci-shard-timings.json
@@ -8014,7 +8014,6 @@
"src/renderer/src/components/native-chat/native-chat-floating-file-drop.test.tsx": 577,
"src/renderer/src/components/native-chat/native-chat-font-size.test.ts": 64,
"src/renderer/src/components/native-chat/native-chat-header-ownership.test.tsx": 2221,
- "src/renderer/src/components/native-chat/native-chat-http-link-source-owner.test.ts": 46,
"src/renderer/src/components/native-chat/native-chat-image-paste.test.ts": 102,
"src/renderer/src/components/native-chat/native-chat-image-references.test.tsx": 2007,
"src/renderer/src/components/native-chat/native-chat-image-runtime-context.test.ts": 1329,
@@ -9221,7 +9220,6 @@
"src/renderer/src/components/status-bar/SkillUpdateStatusSegment.test.tsx": 436,
"src/renderer/src/components/status-bar/SshStatusSegment.large-host-list.test.tsx": 1552,
"src/renderer/src/components/status-bar/SshStatusSegment.managed-hosts.test.tsx": 1316,
- "src/renderer/src/components/status-bar/SshStatusSegment.test.ts": 1399,
"src/renderer/src/components/status-bar/StatusBar.language-change.test.tsx": 2348,
"src/renderer/src/components/status-bar/StatusBarUsageChangeNotices.test.tsx": 574,
"src/renderer/src/components/status-bar/StatusBarUsageEmptyCta.test.tsx": 1333,
diff --git a/src/renderer/src/components/github-item-dialog/discuss-item/conversation-tab-timeline.test.tsx b/src/renderer/src/components/github-item-dialog/discuss-item/conversation-tab-timeline.test.tsx
deleted file mode 100644
index 36dca14b16c..00000000000
--- a/src/renderer/src/components/github-item-dialog/discuss-item/conversation-tab-timeline.test.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { renderToStaticMarkup } from 'react-dom/server'
-import { describe, expect, it } from 'vitest'
-import type { GitHubIssueTimelineItem } from '../../../../../shared/github/comment-types'
-import { renderTimelineActivityMessage } from './conversation-tab-timeline'
-
-function messageText(activity: Partial<GitHubIssueTimelineItem>): string {
- const markup = renderToStaticMarkup(
- <>
- {renderTimelineActivityMessage({
- id: 'event-1',
- event: 'closed',
- actor: 'octocat',
- actorAvatarUrl: '',
- createdAt: '2026-01-01T00:00:00Z',
- ...activity
- })}
- </>
- )
- return markup.replace(/<[^>]+>/g, '')
-}
-
-describe('renderTimelineActivityMessage', () => {
- it('renders the close reason and closing pull request as one sentence', () => {
- expect(
- messageText({
- stateReason: 'not_planned',
- closer: { type: 'pr', number: 7, title: 'Fix it', url: 'https://example.com/7' }
- })
- ).toBe('octocat closed this as not planned in PR #7 Fix it')
- })
-
- it('renders project column moves without a missing source column', () => {
- expect(
- messageText({
- event: 'moved_columns_in_project',
- columnName: 'Done',
- projectName: 'Roadmap'
- })
- ).toBe('octocat moved this to Done in Roadmap')
- })
-})
diff --git a/src/renderer/src/components/native-chat/native-chat-appearance-style.test.ts b/src/renderer/src/components/native-chat/native-chat-appearance-style.test.ts
index 191739c81ff..b9d7580f3db 100644
--- a/src/renderer/src/components/native-chat/native-chat-appearance-style.test.ts
+++ b/src/renderer/src/components/native-chat/native-chat-appearance-style.test.ts
@@ -1,29 +1,11 @@
-import { afterEach, describe, expect, it, vi } from 'vitest'
+import { describe, expect, it } from 'vitest'
import { createGlobalSettingsFixture } from '../../../../shared/global-settings-test-fixture'
import { buildFontFamily } from '@/lib/monospace-font-family'
import { buildAppFontFamily } from '@/lib/app-font-family'
-import * as terminalThemeSelection from '../../../../shared/terminal-theme-selection'
import { resolveConfiguredTerminalColors } from '../../../../shared/terminal-theme-selection'
-import { nativeChatAppearanceStyle, nativeChatContrastMix } from './native-chat-appearance-style'
+import { nativeChatAppearanceStyle } from './native-chat-appearance-style'
const makeSettings = createGlobalSettingsFixture
-afterEach(() => vi.restoreAllMocks())
-
-describe('nativeChatContrastMix', () => {
- it.each([
- [50, false, 56],
- [100, false, 78],
- [150, false, 100],
- [50, true, 64],
- [100, true, 82],
- [150, true, 100],
- [-100, false, 56],
- [200, true, 100],
- [Number.NaN, false, 78]
- ])('maps %s in light mode %s to %s', (contrast, light, expected) => {
- expect(nativeChatContrastMix(contrast, light)).toBe(expected)
- })
-})
describe('nativeChatAppearanceStyle terminal interface', () => {
it('uses a custom chat family while preserving code fonts and terminal matching precedence', () => {
@@ -48,27 +30,6 @@ describe('nativeChatAppearanceStyle terminal interface', () => {
})['--chat-font-family']
).toBeUndefined()
})
- it('follows the terminal code font while keeping default body font and colors', () => {
- const style = nativeChatAppearanceStyle(makeSettings({ terminalFontFamily: 'Menlo' }))
- expect(style['--chat-code-font-family']).toBe(buildFontFamily('Menlo'))
- expect(style['--chat-font-family']).toBeUndefined()
- expect(style['--chat-source-foreground']).toBeUndefined()
- expect(style['--chat-source-background']).toBeUndefined()
- expect(style['--chat-foreground-mix']).toBe('78%')
- })
-
- it('updates the code font and matching body font from the current terminal setting', () => {
- for (const terminalFontFamily of ['', 'Menlo', 'Consolas']) {
- const settings = makeSettings({
- terminalFontFamily,
- nativeChatAppearance: { matchTerminalInterface: true }
- })
- const style = nativeChatAppearanceStyle(settings)
- expect(style['--chat-font-family']).toBe(buildFontFamily(terminalFontFamily))
- expect(style['--chat-code-font-family']).toBe(buildFontFamily(terminalFontFamily))
- expect(style['--chat-code-font-size']).toBe(`${settings.terminalFontSize}px`)
- }
- })
it('uses the selected theme and live overrides as the two palette sources', () => {
const settings = makeSettings({
@@ -105,21 +66,6 @@ describe('nativeChatAppearanceStyle terminal interface', () => {
)
})
- it('uses light formulas for a light terminal inside a dark app', () => {
- const settings = makeSettings({
- theme: 'dark',
- terminalThemeDark: 'Builtin Tango Light',
- nativeChatAppearance: { matchTerminalInterface: true }
- })
- const style = nativeChatAppearanceStyle(settings)
- const colors = resolveConfiguredTerminalColors(settings, true)
- expect(style['--chat-source-background']).toBe(colors.background)
- expect(style['--chat-source-foreground']).toBe(colors.foreground)
- expect(style['--chat-foreground-mix']).toBe('100%')
- expect(style['--chat-code-base']).toBe('var(--chat-canvas)')
- expect(style['--chat-strong-mix']).toBe('100%')
- })
-
it('follows the separate light theme and system theme changes', () => {
const settings = makeSettings({
theme: 'system',
@@ -136,18 +82,6 @@ describe('nativeChatAppearanceStyle terminal interface', () => {
expect(light['--chat-foreground-mix']).toBe('100%')
})
- it('uses app light contrast without matching and removes matching overrides when off', () => {
- const style = nativeChatAppearanceStyle(
- makeSettings({
- theme: 'light',
- nativeChatAppearance: { matchTerminalInterface: false, contrast: 50 }
- })
- )
- expect(style['--chat-foreground-mix']).toBe('64%')
- expect(style['--chat-font-family']).toBeUndefined()
- expect(style['--chat-canvas-mix']).toBeUndefined()
- })
-
it('uses live terminal size and full foreground while matching, then restores saved chat sizes and contrast', () => {
const settings = makeSettings({
terminalFontSize: 17,
@@ -179,39 +113,9 @@ describe('nativeChatAppearanceStyle terminal interface', () => {
'--chat-foreground-mix': '56%'
})
})
-
- it('lets message text follow any terminal size while controls and spacing stay in 12-20', () => {
- const at = (terminalFontSize: number) =>
- nativeChatAppearanceStyle(
- makeSettings({ terminalFontSize, nativeChatAppearance: { matchTerminalInterface: true } })
- )
- expect(at(24)).toMatchObject({
- '--chat-font-size': '24px',
- '--chat-code-font-size': '24px',
- '--chat-ui-font-size': '20px',
- '--chat-estimated-line-height': (22 * 24) / 14,
- '--chat-estimated-spacing-scale': 20 / 14
- })
- expect(at(10)).toMatchObject({
- '--chat-font-size': '10px',
- '--chat-ui-font-size': '12px',
- '--chat-estimated-spacing-scale': 12 / 14
- })
- expect(at(16)['--chat-ui-font-size']).toBe('16px')
- })
})
describe('chat root appearance style', () => {
- it('derives wrap capacity from actual column width, including full-width panes', () => {
- const wide = nativeChatAppearanceStyle({ nativeChatAppearance: { width: 'wide' } })
- const full = nativeChatAppearanceStyle({ nativeChatAppearance: { width: 'full' } }, 1200)
- expect(wide['--chat-estimated-chars-per-line']).toBeGreaterThan(96)
- expect(full['--chat-estimated-chars-per-line']).toBeGreaterThan(
- wide['--chat-estimated-chars-per-line']
- )
- expect(nativeChatAppearanceStyle(undefined, 384)['--chat-estimated-chars-per-line']).toBe(50)
- })
-
it.each(['light', 'dark', 'system'] as const)(
'leaves native controls app-owned in %s mode when matching is off',
(theme) => {
@@ -226,67 +130,4 @@ describe('chat root appearance style', () => {
}
}
)
-
- it('clamps sizes on read and derives the column width', () => {
- expect(
- nativeChatAppearanceStyle({
- nativeChatAppearance: { fontSize: 25, codeFontSize: 1, width: 'wide' }
- })
- ).toMatchObject({
- '--chat-font-size': '20px',
- '--chat-code-font-size': '10px',
- '--chat-content-max-width': '60rem'
- })
- expect(
- nativeChatAppearanceStyle({ nativeChatAppearance: { width: 'full' } })[
- '--chat-content-max-width'
- ]
- ).toBe('none')
- })
-})
-
-describe('contrast hierarchy and incomplete terminal palettes', () => {
- it.each(['light', 'dark'] as const)(
- 'keeps strong text above body in %s mode up to the cap',
- (theme) => {
- for (const matching of [false, true]) {
- for (let contrast = 50; contrast <= 150; contrast++) {
- const style = nativeChatAppearanceStyle(
- makeSettings({
- theme,
- terminalColorOverrides:
- theme === 'light'
- ? { background: '#ffffff', foreground: '#000000' }
- : { background: '#000000', foreground: '#ffffff' },
- nativeChatAppearance: { contrast, matchTerminalInterface: matching }
- })
- )
- const body = Number.parseFloat(String(style['--chat-foreground-mix']))
- const strong = Number.parseFloat(String(style['--chat-strong-mix']))
- expect(strong).toBe(Math.min(100, body + (theme === 'light' ? 10 : 12)))
- if (body < 100) {
- expect(strong).toBeGreaterThan(body)
- }
- }
- }
- }
- )
-
- it.each([{}, { background: '#ffffff' }, { foreground: '#000000' }])(
- 'uses the fallback source pair for an incomplete palette %j',
- (colors) => {
- vi.spyOn(terminalThemeSelection, 'resolveConfiguredTerminalColors').mockReturnValue(colors)
- for (const theme of ['light', 'dark'] as const) {
- const style = nativeChatAppearanceStyle(
- makeSettings({
- theme,
- nativeChatAppearance: { matchTerminalInterface: true }
- })
- )
- expect(style['--chat-source-background']).toBe('#000000')
- expect(style['--chat-source-foreground']).toBe('#fafafa')
- expect(style.colorScheme).toBe('dark')
- }
- }
- )
})
diff --git a/src/renderer/src/components/native-chat/native-chat-http-link-source-owner.test.ts b/src/renderer/src/components/native-chat/native-chat-http-link-source-owner.test.ts
deleted file mode 100644
index 1bcff7c03c3..00000000000
--- a/src/renderer/src/components/native-chat/native-chat-http-link-source-owner.test.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import { afterEach, describe, expect, it, vi } from 'vitest'
-import type { AppState } from '@/store/types'
-import {
- canNativeChatOpenOwnedBrowser,
- resolveNativeChatHttpLinkSourceOwner
-} from './native-chat-http-link-source-owner'
-
-const mocks = vi.hoisted(() => ({
- runtimeEnvironmentIdOrLocalUnlessTwin: vi.fn(),
- getConnectionIdFromState: vi.fn(),
- canOpenWorkspaceBrowserTabOnRuntime: vi.fn(),
- canOpenWorkspaceBrowserTabOnSsh: vi.fn()
-}))
-
-vi.mock('@/lib/worktree-runtime-owner', () => ({
- runtimeEnvironmentIdOrLocalUnlessTwin: mocks.runtimeEnvironmentIdOrLocalUnlessTwin
-}))
-vi.mock('@/lib/connection-owner-resolution', () => ({
- getConnectionIdFromState: mocks.getConnectionIdFromState
-}))
-vi.mock('@/lib/workspace-browser-route-eligibility', () => ({
- canOpenWorkspaceBrowserTabOnRuntime: mocks.canOpenWorkspaceBrowserTabOnRuntime,
- canOpenWorkspaceBrowserTabOnSsh: mocks.canOpenWorkspaceBrowserTabOnSsh
-}))
-
-const state = {} as AppState
-
-afterEach(() => {
- vi.clearAllMocks()
-})
-
-describe('resolveNativeChatHttpLinkSourceOwner', () => {
- it('prefers the workspace runtime owner', () => {
- mocks.runtimeEnvironmentIdOrLocalUnlessTwin.mockReturnValue('env-1')
-
- expect(resolveNativeChatHttpLinkSourceOwner(state, 'wt-1')).toEqual({
- kind: 'runtime',
- runtimeEnvironmentId: 'env-1'
- })
- expect(mocks.getConnectionIdFromState).not.toHaveBeenCalled()
- })
-
- it('falls back to the SSH connection that owns the workspace', () => {
- mocks.runtimeEnvironmentIdOrLocalUnlessTwin.mockReturnValue(null)
- mocks.getConnectionIdFromState.mockReturnValue('ssh-1')
-
- expect(resolveNativeChatHttpLinkSourceOwner(state, 'wt-1')).toEqual({
- kind: 'ssh',
- connectionId: 'ssh-1'
- })
- })
-
- it('reads a null connection as local', () => {
- mocks.runtimeEnvironmentIdOrLocalUnlessTwin.mockReturnValue(null)
- mocks.getConnectionIdFromState.mockReturnValue(null)
-
- expect(resolveNativeChatHttpLinkSourceOwner(state, 'wt-1')).toEqual({ kind: 'local' })
- })
-
- // Unknown ownership cannot default local because remote links would route to the wrong host.
- it('reports an unresolved owner as unknown', () => {
- mocks.runtimeEnvironmentIdOrLocalUnlessTwin.mockReturnValue(null)
- mocks.getConnectionIdFromState.mockReturnValue(undefined)
-
- expect(resolveNativeChatHttpLinkSourceOwner(state, 'wt-1')).toEqual({ kind: 'unknown' })
- })
-})
-
-describe('canNativeChatOpenOwnedBrowser', () => {
- it('asks the runtime browser-route check for a runtime owner', () => {
- mocks.canOpenWorkspaceBrowserTabOnRuntime.mockReturnValue(true)
-
- expect(
- canNativeChatOpenOwnedBrowser(state, 'wt-1', {
- kind: 'runtime',
- runtimeEnvironmentId: 'env-1'
- })
- ).toBe(true)
- expect(mocks.canOpenWorkspaceBrowserTabOnRuntime).toHaveBeenCalledWith(state, 'wt-1', 'env-1')
- })
-
- it('asks the SSH browser-route check for an SSH owner', () => {
- mocks.canOpenWorkspaceBrowserTabOnSsh.mockReturnValue(false)
-
- expect(
- canNativeChatOpenOwnedBrowser(state, 'wt-1', { kind: 'ssh', connectionId: 'ssh-1' })
- ).toBe(false)
- expect(mocks.canOpenWorkspaceBrowserTabOnSsh).toHaveBeenCalledWith(state, 'wt-1', 'ssh-1')
- })
-
- it('never claims an owned browser for local or unknown owners', () => {
- expect(canNativeChatOpenOwnedBrowser(state, 'wt-1', { kind: 'local' })).toBe(false)
- expect(canNativeChatOpenOwnedBrowser(state, 'wt-1', { kind: 'unknown' })).toBe(false)
- })
-})
diff --git a/src/renderer/src/components/native-chat/use-native-chat-appearance-style.test.tsx b/src/renderer/src/components/native-chat/use-native-chat-appearance-style.test.tsx
index 18a706383eb..ed502e474ac 100644
--- a/src/renderer/src/components/native-chat/use-native-chat-appearance-style.test.tsx
+++ b/src/renderer/src/components/native-chat/use-native-chat-appearance-style.test.tsx
@@ -78,36 +78,6 @@ describe('shared chat appearance hook', () => {
expect(resolveColors).toHaveBeenCalledTimes(4)
})
- it('invalidates the style for each appearance input', () => {
- const settings = createGlobalSettingsFixture({
- theme: 'dark',
- terminalThemeDark: 'Builtin Tango Dark',
- terminalThemeLight: '',
- nativeChatAppearance: { matchTerminalInterface: true }
- })
- const updates: Partial<GlobalSettings>[] = [
- { theme: 'light' },
- { terminalThemeDark: 'Builtin Tango Light' },
- { terminalThemeLight: 'Builtin Tango Light' },
- { terminalUseSeparateLightTheme: !settings.terminalUseSeparateLightTheme },
- { terminalCustomThemes: [] },
- { terminalColorOverrides: { background: '#122033', foreground: '#ddeeff' } },
- { terminalFontFamily: 'Menlo' },
- { terminalFontSize: settings.terminalFontSize + 1 },
- { nativeChatAppearance: { matchTerminalInterface: true, contrast: 120 } }
- ]
- const { result, rerender } = renderHook(
- (settings: GlobalSettings) => useNativeChatAppearanceStyle(settings),
- { initialProps: settings }
- )
- for (const update of updates) {
- rerender(settings)
- const style = result.current
- rerender({ ...settings, ...update })
- expect(result.current, Object.keys(update).join(',')).not.toBe(style)
- }
- })
-
it('ignores terminal size changes while matching is off', () => {
const settings = createGlobalSettingsFixture({ nativeChatAppearance: { fontSize: 18 } })
const { result, rerender } = renderHook(
diff --git a/src/renderer/src/components/status-bar/SshStatusSegment.test.ts b/src/renderer/src/components/status-bar/SshStatusSegment.test.ts
deleted file mode 100644
index 5d7fc160030..00000000000
--- a/src/renderer/src/components/status-bar/SshStatusSegment.test.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import { describe, expect, it, vi } from 'vitest'
-import { connectRuntimeHostForNavigation } from './runtime-environment-explicit-connect'
-
-describe('connectRuntimeHostForNavigation', () => {
- it('loads the transient host catalog without writing Active Server', async () => {
- const refreshStatus = vi.fn().mockResolvedValue(true)
- const fetchRepos = vi.fn().mockResolvedValue([{ id: 'repo-a' }, { id: 'repo-b' }])
- const fetchWorktrees = vi.fn().mockResolvedValue(undefined)
- const fetchLineage = vi.fn().mockResolvedValue(undefined)
-
- await expect(
- connectRuntimeHostForNavigation({
- environmentId: 'windows-2',
- refreshStatus,
- fetchRepos,
- fetchWorktrees,
- fetchLineage
- })
- ).resolves.toBe(true)
-
- expect(fetchRepos).toHaveBeenCalledWith('windows-2')
- expect(fetchWorktrees).toHaveBeenCalledTimes(2)
- expect(fetchWorktrees).toHaveBeenNthCalledWith(1, 'repo-a', {
- executionHostId: 'runtime:windows-2',
- suppressRemoteLineageRefresh: true
- })
- expect(fetchWorktrees).toHaveBeenNthCalledWith(2, 'repo-b', {
- executionHostId: 'runtime:windows-2',
- suppressRemoteLineageRefresh: true
- })
- expect(fetchLineage).toHaveBeenCalledOnce()
- expect(fetchLineage).toHaveBeenCalledWith({ executionHostId: 'runtime:windows-2' })
- })
-
- it('does not load a catalog when the server is unreachable', async () => {
- const fetchRepos = vi.fn()
- await expect(
- connectRuntimeHostForNavigation({
- environmentId: 'windows-2',
- refreshStatus: vi.fn().mockResolvedValue(false),
- fetchRepos,
- fetchWorktrees: vi.fn(),
- fetchLineage: vi.fn()
- })
- ).resolves.toBe(false)
- expect(fetchRepos).not.toHaveBeenCalled()
- })
-})