test: remove 17 low-value cases and seven suites (#35394)

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-10-28 19:04:19 -07:00
committed by GitHub
co-authored by OrcaWin
parent 366eaffa99
commit 7802d16fda
10 changed files with 0 additions and 335 deletions
-5
View File
@@ -9453,7 +9453,6 @@
"src/renderer/src/components/task-page-jira-text-fallback-notice.test.tsx": 375,
"src/renderer/src/components/task-page-jira-workspace-actions.test.tsx": 1971,
"src/renderer/src/components/task-page/task-page-list-chrome-visibility.test.ts": 33,
"src/renderer/src/components/task-page/task-page-localized-options.test.ts": 211,
"src/renderer/src/components/task-page/task-page-mutation-page-allocation.test.ts": 128,
"src/renderer/src/components/task-page/task-page-new-issue-draft.test.ts": 76,
"src/renderer/src/components/task-page/task-page-repo-source-divergence.test.ts": 1043,
@@ -10220,7 +10219,6 @@
"src/renderer/src/hooks/ipc-events/agent-status-reconnect-replay-notification.test.ts": 224,
"src/renderer/src/hooks/ipc-events/agent-status-refused-resume.performance.test.ts": 1640,
"src/renderer/src/hooks/ipc-events/agent-status-terminal-title-tab-write.test.ts": 1604,
"src/renderer/src/hooks/ipc-events/agent-status-unavailable.test.ts": 192,
"src/renderer/src/hooks/ipc-events/browser-automation-bootstrap-lease.test.ts": 181,
"src/renderer/src/hooks/ipc-events/browser-request-ipc-bridge.owner.test.ts": 465,
"src/renderer/src/hooks/ipc-events/browser-request-ipc-bridge.profile-switch.test.ts": 347,
@@ -11574,7 +11572,6 @@
"src/renderer/src/store/slices/github-pr-rejected-cache.test.ts": 466,
"src/renderer/src/store/slices/github-pr-request-lifetime.test.ts": 1143,
"src/renderer/src/store/slices/github-project-request-coordination.test.ts": 391,
"src/renderer/src/store/slices/github-project-row-owner.test.ts": 41,
"src/renderer/src/store/slices/github-project-view-tables.test.ts": 436,
"src/renderer/src/store/slices/github-provider-request-concurrency.test.ts": 454,
"src/renderer/src/store/slices/github-refresh-sweep.test.ts": 709,
@@ -11632,7 +11629,6 @@
"src/renderer/src/store/slices/removed-worktree-diff-memory.test.ts": 2838,
"src/renderer/src/store/slices/repo-host-identity.test.ts": 34,
"src/renderer/src/store/slices/repo-identity-reconcile.test.ts": 49,
"src/renderer/src/store/slices/repo-owner-cache-identity.test.ts": 44,
"src/renderer/src/store/slices/repo-reorder-host-split.test.ts": 25,
"src/renderer/src/store/slices/repos-add-races.test.ts": 1207,
"src/renderer/src/store/slices/repos-all-hosts-generation.test.ts": 1188,
@@ -11669,7 +11665,6 @@
"src/renderer/src/store/slices/runtime-status-catalog-identity.test.ts": 286,
"src/renderer/src/store/slices/runtime-status-first-publication.test.ts": 329,
"src/renderer/src/store/slices/runtime-status-reconnect-connection-generation.test.ts": 1219,
"src/renderer/src/store/slices/runtime-status-refresh-diagnostics.test.ts": 37,
"src/renderer/src/store/slices/runtime-status-restored-browser-host-attach.test.ts": 376,
"src/renderer/src/store/slices/runtime-status-skill-cache-eviction.test.ts": 269,
"src/renderer/src/store/slices/runtime-status-snapshot.test.ts": 378,
@@ -10,16 +10,6 @@ function clock(times: number[]): () => number {
}
describe('createOrcadStartupTiming', () => {
it('stays silent and untimed without the lane env', async () => {
const lines: string[] = []
const timing = createOrcadStartupTiming({}, clock([]), (line) => lines.push(line))
await expect(timing.time('daemon', async () => 'ok')).resolves.toBe('ok')
timing.report()
expect(lines).toEqual([])
})
it('reports each phase, failed ones included, in one line', async () => {
const lines: string[] = []
const timing = createOrcadStartupTiming(
@@ -1,40 +0,0 @@
import { describe, expect, it } from 'vitest'
import {
describeBrowserExtensionAccess,
describeUnsupportedBrowserExtensionFeatures
} from './browser-extension-permission-messages'
describe('extension permission messages', () => {
it('lists content blocking the way Chrome does, now that Orca enforces it', () => {
// uBlock Origin Lite's permissions.
const permissions = ['activeTab', 'declarativeNetRequest', 'scripting', 'storage']
expect(describeBrowserExtensionAccess(permissions, ['<all_urls>'])).toEqual([
'Read and change all your data on all websites',
'Block content on any page'
])
expect(describeUnsupportedBrowserExtensionFeatures(permissions)).toBeNull()
})
it('names every unsupported feature once and stays silent when there are none', () => {
expect(
describeUnsupportedBrowserExtensionFeatures([
'nativeMessaging',
'identity',
'identity.email',
'declarativeNetRequestWithHostAccess'
])
).toBe('Not available in Orca yet: extension sign-in.')
expect(describeUnsupportedBrowserExtensionFeatures(['tabs', 'storage'])).toBeNull()
expect(describeBrowserExtensionAccess(['tabs', 'webNavigation', 'storage'], [])).toEqual([
'Read your browsing history'
])
})
it('warns about talking to desktop apps the way Chrome does, now that Orca supports it', () => {
// Bitwarden's shape: native messaging requested up front.
expect(describeBrowserExtensionAccess(['storage', 'nativeMessaging'], [])).toEqual([
'Communicate with cooperating native applications'
])
expect(describeUnsupportedBrowserExtensionFeatures(['nativeMessaging'])).toBeNull()
})
})
@@ -1,58 +0,0 @@
import { beforeEach, describe, expect, it } from 'vitest'
import { i18n } from '@/i18n/i18n'
import {
getGitHubModeButtons,
getGitHubTaskKindPresets,
getLinearPriorityLabel
} from './task-page-localized-options'
describe('task-page-localized-options', () => {
beforeEach(async () => {
await i18n.changeLanguage('en')
})
it('refreshes GitHub task labels when the UI language changes', async () => {
expect(getGitHubTaskKindPresets('issues').map((preset) => preset.label)).toEqual([
'Open',
'Assigned to me'
])
expect(getGitHubModeButtons().map((button) => button.label)).toEqual([
'Issues',
'PRs',
'Projects'
])
await i18n.changeLanguage('ko')
expect(getGitHubTaskKindPresets('issues').map((preset) => preset.label)).toEqual([
'열기',
'나에게 할당됨'
])
expect(getGitHubModeButtons().map((button) => button.label)).toEqual(['이슈', 'PR', '프로젝트'])
await i18n.changeLanguage('en')
expect(getGitHubTaskKindPresets('issues').map((preset) => preset.label)).toEqual([
'Open',
'Assigned to me'
])
expect(getGitHubModeButtons().map((button) => button.label)).toEqual([
'Issues',
'PRs',
'Projects'
])
})
it('refreshes Linear priority labels when the UI language changes', async () => {
expect(getLinearPriorityLabel(0)).toBe('No priority')
await i18n.changeLanguage('ko')
expect(getLinearPriorityLabel(0)).toBe('우선순위 없음')
await i18n.changeLanguage('en')
expect(getLinearPriorityLabel(0)).toBe('No priority')
})
})
@@ -1,45 +0,0 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import type { AgentStatusClearIpcPayload } from '../../../../shared/agent-status-types'
import { registerAgentStatusListeners } from './agent-status-listeners'
const store = vi.hoisted(() => ({
agentStatusByPaneKey: { pane: { state: 'done' } },
removeAgentStatus: vi.fn()
}))
vi.mock('../../store', () => ({ useAppStore: { getState: () => store } }))
afterEach(() => {
vi.unstubAllGlobals()
vi.clearAllMocks()
})
describe('host-selected status unavailable', () => {
it('removes a completed projection only for an explicit unavailable or program-removal clear', () => {
let clear: ((event: AgentStatusClearIpcPayload) => void) | undefined
vi.stubGlobal('window', {
api: {
agentStatus: {
onSet: () => () => {},
onClear: (callback: typeof clear) => {
clear = callback
return () => {}
}
}
}
})
registerAgentStatusListeners({
unsubs: [],
enqueueLiveAgentStatus: vi.fn(),
drainQueuedLiveAgentStatusesForPane: vi.fn(),
pendingAgentStatusEvents: [],
transientClearWatermarkByConnectionId: new Map(),
liveAgentStatusBurstQueue: []
})
clear?.({ paneKey: 'pane' })
expect(store.removeAgentStatus).not.toHaveBeenCalled()
clear?.({ paneKey: 'pane', statusUnavailable: true })
expect(store.removeAgentStatus).toHaveBeenCalledWith('pane')
store.removeAgentStatus.mockClear()
clear?.({ paneKey: 'pane', programStatusRemoved: true })
expect(store.removeAgentStatus).toHaveBeenCalledWith('pane')
})
})
@@ -1,45 +0,0 @@
import { describe, expect, it, vi, beforeEach } from 'vitest'
import type { Repo } from '../../../../shared/repo-types'
import { runtimeTargetForProjectRowOwner } from './github-project-row-owner'
import { lookupReposBySlugFromCache } from '@/lib/repo-slug-cache'
vi.mock('@/lib/repo-slug-cache', () => ({
lookupReposBySlugFromCache: vi.fn()
}))
const mockedLookup = vi.mocked(lookupReposBySlugFromCache)
function repo(id: string, executionHostId: string | null): Repo {
return { id, executionHostId, connectionId: null } as unknown as Repo
}
describe('runtimeTargetForProjectRowOwner', () => {
beforeEach(() => {
mockedLookup.mockReset()
})
it('routes to the matched repo owner host when the slug matches', () => {
mockedLookup.mockReturnValue([repo('repo-1', 'runtime:owner-env')])
const state = {
repos: [repo('repo-1', 'runtime:owner-env')],
settings: { activeRuntimeEnvironmentId: 'focused-env' }
}
expect(
runtimeTargetForProjectRowOwner(state, 'acme', 'widgets', undefined, { kind: 'local' })
).toEqual({ kind: 'environment', environmentId: 'owner-env' })
})
it('falls back to the host the row was loaded from, not focus, when no repo matches', () => {
mockedLookup.mockReturnValue([])
const state = {
repos: [repo('repo-1', 'runtime:owner-env')],
settings: { activeRuntimeEnvironmentId: 'focused-env' }
}
expect(
runtimeTargetForProjectRowOwner(state, 'acme', 'widgets', undefined, {
kind: 'environment',
environmentId: 'board-env'
})
).toEqual({ kind: 'environment', environmentId: 'board-env' })
})
})
@@ -1,42 +0,0 @@
import { describe, expect, it } from 'vitest'
import { getGitHubPRCacheKey } from '../../../../shared/github/github-cache-key'
import { getHostedReviewCacheKey } from './hosted-review-cache-identity'
const focusedRuntime = { activeRuntimeEnvironmentId: 'env-focused' }
describe('repo owner cache identity', () => {
it('uses local PR and hosted-review keys for known local repos while a runtime is focused', () => {
expect(
getGitHubPRCacheKey('/repo', 'repo-1', 'feature/local', focusedRuntime, null, null, true)
).toBe('repo-1::feature/local')
expect(
getHostedReviewCacheKey('/repo', 'feature/local', focusedRuntime, 'repo-1', null, null, true)
).toBe('local::repo-1::feature/local')
})
it('preserves focused-runtime fallback when repo owner context is missing', () => {
expect(getGitHubPRCacheKey('/repo', 'repo-1', 'feature/local', focusedRuntime)).toBe(
'runtime:env-focused::repo-1::feature/local'
)
expect(getHostedReviewCacheKey('/repo', 'feature/local', focusedRuntime, 'repo-1')).toBe(
'runtime:env-focused::repo-1::feature/local'
)
})
it('keeps explicit runtime and SSH owners scoped to their owner host', () => {
expect(
getGitHubPRCacheKey(
'/repo',
'repo-1',
'feature/remote',
null,
null,
'runtime:env-owner',
true
)
).toBe('runtime:env-owner::repo-1::feature/remote')
expect(
getHostedReviewCacheKey('/repo', 'feature/ssh', focusedRuntime, 'repo-1', 'ssh-1', null, true)
).toBe('ssh:ssh-1::repo-1::feature/ssh')
})
})
@@ -1,53 +0,0 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import type { RemoteRuntimeSharedConnectionDiagnostics } from '../../../../shared/remote-runtime/control/remote-runtime-shared-control-types'
import { refreshRuntimeEnvironmentStatus } from './runtime-status-refresh'
import { stubRuntimeEnvironmentBridge } from '../../runtime/runtime-environment-bridge-fixture'
afterEach(() => {
vi.unstubAllGlobals()
})
describe('refreshRuntimeEnvironmentStatus diagnostics', () => {
it('publishes shared-control diagnostics from failed status probes', async () => {
const remoteControl = diagnostics('ready')
const getStatus = vi.fn().mockResolvedValue({
id: 'status.get',
ok: false,
error: {
code: 'runtime_unavailable',
message: 'offline',
data: { remoteControl }
},
_meta: { runtimeId: null }
})
stubRuntimeEnvironmentBridge({ getStatus })
const publish = vi.fn()
const applySnapshot = vi.fn()
await expect(
refreshRuntimeEnvironmentStatus('env-a', 5_000, publish, applySnapshot)
).resolves.toBe(false)
expect(getStatus).toHaveBeenCalledWith({ selector: 'env-a', timeoutMs: 5_000 })
expect(publish).toHaveBeenCalledWith({
status: null,
remoteControl,
checkedAt: expect.any(Number)
})
})
})
function diagnostics(
state: RemoteRuntimeSharedConnectionDiagnostics['state']
): RemoteRuntimeSharedConnectionDiagnostics {
return {
state,
pendingRequestCount: 0,
subscriptionCount: 1,
reconnectAttempt: 0,
lastConnectedAt: 123,
lastClose: null,
lastError: null
}
}
@@ -9,12 +9,6 @@ const address = {
}
describe('parseRemoteFilePreviewAddress', () => {
it('keeps only the address fields', () => {
expect(parseRemoteFilePreviewAddress({ ...address, extra: 'ignored' })).toEqual(address)
const { expectedEnvironmentPairingRevision: _revision, ...unpinned } = address
expect(parseRemoteFilePreviewAddress(unpinned)).toEqual(unpinned)
})
it.each([
{ relativePath: '/etc/a.mp4' },
{ relativePath: 'C:\\a.mp4' },
-31
View File
@@ -1,31 +0,0 @@
import { describe, expect, it } from 'vitest'
import {
formatWslHostsServeOnlyArgument,
hasWslHostsServeOnlyArgument,
resolveWslHostsGateState
} from './wsl-host-internal-gate'
describe('WSL hosts gate state', () => {
it('is open whenever the internal gate is, whatever is saved', () => {
for (const hasSavedWslHost of [false, true]) {
for (const hasWslMoveCutover of [false, true]) {
expect(
resolveWslHostsGateState({ gateOpen: true, hasSavedWslHost, hasWslMoveCutover })
).toBe('open')
}
}
})
it('promotes a closed gate to serve-only for a saved host or a move journal entry, else stays closed', () => {
const closed = { gateOpen: false, hasSavedWslHost: false, hasWslMoveCutover: false }
expect(resolveWslHostsGateState(closed)).toBe('closed')
expect(resolveWslHostsGateState({ ...closed, hasSavedWslHost: true })).toBe('serve-only')
expect(resolveWslHostsGateState({ ...closed, hasWslMoveCutover: true })).toBe('serve-only')
})
it('reads back only the serve-only argument main stamps', () => {
expect(hasWslHostsServeOnlyArgument(['--x', formatWslHostsServeOnlyArgument()])).toBe(true)
expect(hasWslHostsServeOnlyArgument(['--orca-wsl-hosts-serve-only=0'])).toBe(false)
expect(hasWslHostsServeOnlyArgument([])).toBe(false)
})
})