From 4e834bf939ffe5fa0c152455e554957e3645933e Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Sun, 15 Nov 2026 01:25:47 -0800 Subject: [PATCH] test: remove 11 low-value suites and theme/NVM policy cases from combined audit (#42678) Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> --- .../scripts/ci/sharding/ci-shard-timings.json | 10 -- .../catalog/structural-equality.test.ts | 16 --- src/main/ghostty/index.test.ts | 26 ---- src/main/warp-themes/discovery.test.ts | 123 ------------------ src/main/warp-themes/index.test.ts | 112 +--------------- src/main/warp-themes/parser-runner.test.ts | 105 --------------- src/main/warp-themes/parser.test.ts | 97 -------------- .../warp-themes/theme-file-scanner.test.ts | 35 ----- .../github/accounts/account-binding.test.ts | 15 --- src/shared/kiro-home.test.ts | 10 -- src/shared/nvm-default-alias.test.ts | 33 ----- .../plugin-vm-recipe-artifact.test.ts | 19 --- src/shared/preferred-git-remote.test.ts | 10 -- .../terminal-create-shell-param.test.ts | 17 --- .../tab-groups/tab-order-moves.test.ts | 13 -- 15 files changed, 3 insertions(+), 638 deletions(-) delete mode 100644 mobile/src/worktree/catalog/structural-equality.test.ts delete mode 100644 src/main/warp-themes/discovery.test.ts delete mode 100644 src/main/warp-themes/parser-runner.test.ts delete mode 100644 src/main/warp-themes/parser.test.ts delete mode 100644 src/main/warp-themes/theme-file-scanner.test.ts delete mode 100644 src/shared/github/accounts/account-binding.test.ts delete mode 100644 src/shared/kiro-home.test.ts delete mode 100644 src/shared/plugins/artifacts/plugin-vm-recipe-artifact.test.ts delete mode 100644 src/shared/preferred-git-remote.test.ts delete mode 100644 src/shared/rpc-contract/terminal/terminal-create-shell-param.test.ts delete mode 100644 src/shared/workspace-layout/tab-groups/tab-order-moves.test.ts diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json index 8250eab901d..31492dfb6d6 100644 --- a/config/scripts/ci/sharding/ci-shard-timings.json +++ b/config/scripts/ci/sharding/ci-shard-timings.json @@ -3272,11 +3272,7 @@ "src/main/usage/source-input/jsonl/jsonl-file-reader.test.ts": 112, "src/main/usage/rollups/usage-breakdown-scaling.test.ts": 84, "src/main/usage/cache/usage-source-cache-file.test.ts": 94, - "src/main/warp-themes/discovery.test.ts": 58, "src/main/warp-themes/index.test.ts": 678, - "src/main/warp-themes/parser-runner.test.ts": 51, - "src/main/warp-themes/parser.test.ts": 85, - "src/main/warp-themes/theme-file-scanner.test.ts": 56, "src/main/windows/windows-command-paths.test.ts": 77, "src/main/window/clipboard-agent-session-attachment-paste.test.ts": 585, "src/main/window/clipboard-publisher-executable.test.ts": 62, @@ -4765,7 +4761,6 @@ "src/shared/git/paths/git-tracked-pathspecs.test.ts": 59, "src/shared/git/status/git-uncommitted-line-stats.test.ts": 87, "src/shared/git/worktrees/git-worktree-admin.test.ts": 161, - "src/shared/github/account-binding.test.ts": 48, "src/shared/github/project-board-columns.test.ts": 64, "src/shared/github/project-identity.test.ts": 33, "src/shared/github/project-ref-input.test.ts": 40, @@ -4802,7 +4797,6 @@ "src/shared/keybindings-keyboard-layout.test.ts": 86, "src/shared/keybindings-parsing.test.ts": 86, "src/shared/keybindings-unassigned-actions.test.ts": 73, - "src/shared/kiro-home.test.ts": 39, "src/shared/libproc-addon-worker-teardown.test.ts": 46, "src/shared/libproc-process-table-real-ps.test.ts": 75, "src/shared/libproc-process-table.test.ts": 241, @@ -4926,7 +4920,6 @@ "src/shared/plugins/artifacts/plugin-language-pack-artifact.test.ts": 156, "src/shared/plugins/artifacts/plugin-syntax-artifact.test.ts": 185, "src/shared/plugins/artifacts/plugin-theme-artifact.test.ts": 165, - "src/shared/plugins/artifacts/plugin-vm-recipe-artifact.test.ts": 121, "src/shared/plugins/authoring/plugin-host-typings.test.ts": 2140, "src/shared/plugins/catalog/plugin-catalog.test.ts": 630, "src/shared/plugins/catalog/plugin-kill-list.test.ts": 195, @@ -4959,7 +4952,6 @@ "src/shared/powershell-native-argument.test.ts": 34, "src/shared/powershell-native-argument.windows.test.ts": 67, "src/shared/source-control/checks/pr-checks-fix-prompt.test.ts": 93, - "src/shared/preferred-git-remote.test.ts": 42, "src/shared/priority-semaphore.test.ts": 43, "src/shared/process-growth-breaker.test.ts": 47, "src/shared/process-table-index.test.ts": 127, @@ -5043,7 +5035,6 @@ "src/shared/rpc-contract/session-tabs/session-tabs-create-resume-session-param.test.ts": 259, "src/shared/rpc-contract/structured-agent-session-agent-params.test.ts": 274, "src/shared/queued-message-edit-skills.test.ts": 270, - "src/shared/rpc-contract/terminal/terminal-create-shell-param.test.ts": 182, "src/shared/rpc-contract/workspaces/worktree-review-metadata-compatibility.test.ts": 147, "src/shared/remote-runtime/host-store/runtime-environment-managed-orcad-store.test.ts": 313, "src/shared/remote-runtime/host-store/runtime-environment-sidecar.test.ts": 277, @@ -5172,7 +5163,6 @@ "src/shared/workspace-layout/old-client/old-client-pane-layout-translation.test.ts": 363, "src/shared/workspace-layout/old-client/old-client-session-tabs-projection-owned-editor.test.ts": 178, "src/shared/workspace-layout/old-client/old-client-session-tabs-projection.test.ts": 207, - "src/shared/workspace-layout/tab-groups/tab-order-moves.test.ts": 44, "src/shared/workspace-layout/commands/workspace-layout-agent-session-tab.test.ts": 168, "src/shared/workspace-layout/commands/workspace-layout-browser-commands.test.ts": 177, "src/shared/workspace-layout/persistence/workspace-layout-command-persistence.test.ts": 329, diff --git a/mobile/src/worktree/catalog/structural-equality.test.ts b/mobile/src/worktree/catalog/structural-equality.test.ts deleted file mode 100644 index 6e778b7e377..00000000000 --- a/mobile/src/worktree/catalog/structural-equality.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { areStructurallyEqual } from './structural-equality' - -describe('areStructurallyEqual', () => { - it('equates value-equal nested objects and arrays', () => { - const value = () => ({ id: 'a', agents: [{ state: 'working', mainAgent: { stopping: true } }] }) - expect(areStructurallyEqual(value(), value())).toBe(true) - }) - - it('detects a changed nested value', () => { - expect( - areStructurallyEqual({ agents: [{ state: 'working' }] }, { agents: [{ state: 'done' }] }) - ).toBe(false) - expect(areStructurallyEqual([1, 2], [1, 2, 3])).toBe(false) - }) -}) diff --git a/src/main/ghostty/index.test.ts b/src/main/ghostty/index.test.ts index 39ff6fb3792..e7de7246890 100644 --- a/src/main/ghostty/index.test.ts +++ b/src/main/ghostty/index.test.ts @@ -92,30 +92,4 @@ describe('previewGhosttyImport', () => { diff: { terminalFontSize: 22 } }) }) - - it('keeps successfully imported settings when a later config is too large', async () => { - delete process.env.XDG_CONFIG_HOME - const firstPath = '/Users/alice/.config/ghostty/config.ghostty' - const oversizedPath = '/Users/alice/.config/ghostty/config' - statMock.mockImplementation(async (p: string) => { - if (p === firstPath) { - return { isFile: () => true, size: 128 } - } - if (p === oversizedPath) { - return { isFile: () => true, size: 1_000_001 } - } - throw Object.assign(new Error('ENOENT'), { code: 'ENOENT' }) - }) - readFileMock.mockResolvedValue('font-size = 22\n') - - const result = await previewGhosttyImport(createStore()) - - expect(result).toMatchObject({ - found: true, - configPath: firstPath, - configPaths: [firstPath], - diff: { terminalFontSize: 22 } - }) - expect(readFileMock).not.toHaveBeenCalledWith(oversizedPath, 'utf-8') - }) }) diff --git a/src/main/warp-themes/discovery.test.ts b/src/main/warp-themes/discovery.test.ts deleted file mode 100644 index 0d4c50b723d..00000000000 --- a/src/main/warp-themes/discovery.test.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' - -const platformMock = vi.hoisted(() => vi.fn()) -const homedirMock = vi.hoisted(() => vi.fn(() => '/Users/alice')) -type MockDirectoryEntry = { - name: string - isDirectory: () => boolean -} - -const readdirSyncMock = vi.hoisted(() => vi.fn<() => MockDirectoryEntry[]>(() => [])) - -vi.mock('fs', () => ({ - readdirSync: readdirSyncMock -})) - -vi.mock('os', () => ({ - homedir: homedirMock, - platform: platformMock -})) - -import { getWarpThemeDirectories } from './discovery' - -function directoryEntry(name: string): MockDirectoryEntry { - return { - name, - isDirectory: () => true - } -} - -function fileEntry(name: string): MockDirectoryEntry { - return { - name, - isDirectory: () => false - } -} - -describe('getWarpThemeDirectories', () => { - beforeEach(() => { - vi.unstubAllEnvs() - platformMock.mockReset() - homedirMock.mockReturnValue('/Users/alice') - readdirSyncMock.mockReset() - readdirSyncMock.mockReturnValue([]) - }) - - it('adds dynamic macOS .warp directories after known channels', () => { - platformMock.mockReturnValue('darwin') - readdirSyncMock.mockReturnValue([ - directoryEntry('.warp-future'), - fileEntry('.warp-note'), - directoryEntry('.not-warp'), - directoryEntry('.warp-preview') - ]) - - expect(getWarpThemeDirectories()).toEqual([ - '/Users/alice/.warp/themes', - '/Users/alice/.warp-preview/themes', - '/Users/alice/.warp-oss/themes', - '/Users/alice/.warp-dev/themes', - '/Users/alice/.warp-local/themes', - '/Users/alice/.warp-integration/themes', - '/Users/alice/.warp-future/themes' - ]) - }) - - it('adds dynamic Linux warp data directories', () => { - platformMock.mockReturnValue('linux') - vi.stubEnv('XDG_DATA_HOME', '/data/alice') - readdirSyncMock.mockReturnValue([ - directoryEntry('warp-future'), - directoryEntry('warp-terminal'), - directoryEntry('not-warp'), - fileEntry('warp-note') - ]) - - expect(getWarpThemeDirectories()).toEqual([ - '/data/alice/warp-terminal/themes', - '/data/alice/warp-terminal-preview/themes', - '/data/alice/warp-oss/themes', - '/data/alice/warp-terminal-dev/themes', - '/data/alice/warp-terminal-local/themes', - '/data/alice/warp-terminal-integration/themes', - '/data/alice/warp-future/themes' - ]) - }) - - it('ignores relative Linux XDG data home values', () => { - platformMock.mockReturnValue('linux') - vi.stubEnv('XDG_DATA_HOME', 'relative-data-home') - - expect(getWarpThemeDirectories()).toEqual([ - '/Users/alice/.local/share/warp-terminal/themes', - '/Users/alice/.local/share/warp-terminal-preview/themes', - '/Users/alice/.local/share/warp-oss/themes', - '/Users/alice/.local/share/warp-terminal-dev/themes', - '/Users/alice/.local/share/warp-terminal-local/themes', - '/Users/alice/.local/share/warp-terminal-integration/themes' - ]) - expect(readdirSyncMock).toHaveBeenCalledWith('/Users/alice/.local/share', { - withFileTypes: true - }) - }) - - it('adds dynamic Windows Warp app data directories', () => { - platformMock.mockReturnValue('win32') - vi.stubEnv('APPDATA', 'C:\\Users\\alice\\AppData\\Roaming') - readdirSyncMock.mockReturnValue([ - directoryEntry('WarpFuture'), - directoryEntry('WarpPreview'), - fileEntry('WarpNote') - ]) - - expect(getWarpThemeDirectories()).toEqual([ - 'C:\\Users\\alice\\AppData\\Roaming\\warp\\Warp\\data\\themes', - 'C:\\Users\\alice\\AppData\\Roaming\\warp\\WarpPreview\\data\\themes', - 'C:\\Users\\alice\\AppData\\Roaming\\warp\\WarpOss\\data\\themes', - 'C:\\Users\\alice\\AppData\\Roaming\\warp\\WarpDev\\data\\themes', - 'C:\\Users\\alice\\AppData\\Roaming\\warp\\WarpLocal\\data\\themes', - 'C:\\Users\\alice\\AppData\\Roaming\\warp\\WarpIntegration\\data\\themes', - 'C:\\Users\\alice\\AppData\\Roaming\\warp\\WarpFuture\\data\\themes' - ]) - }) -}) diff --git a/src/main/warp-themes/index.test.ts b/src/main/warp-themes/index.test.ts index d7776d39761..3d527492900 100644 --- a/src/main/warp-themes/index.test.ts +++ b/src/main/warp-themes/index.test.ts @@ -1,12 +1,8 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import path from 'node:path' -import type * as WarpThemeDiscovery from './discovery' -const opendirMock = vi.hoisted(() => vi.fn()) const readFileMock = vi.hoisted(() => vi.fn()) -const realpathMock = vi.hoisted(() => vi.fn((filePath: string) => Promise.resolve(filePath))) const statMock = vi.hoisted(() => vi.fn()) -const getWarpThemeDirectoriesMock = vi.hoisted(() => vi.fn(() => ['/Users/alice/.warp/themes'])) const parseWarpThemeYamlWithTimeoutMock = vi.hoisted(() => vi.fn()) const showOpenDialogMock = vi.hoisted(() => vi.fn()) @@ -16,20 +12,12 @@ vi.mock('electron', () => ({ })) vi.mock('fs/promises', () => ({ - opendir: opendirMock, + opendir: vi.fn(), readFile: readFileMock, - realpath: realpathMock, + realpath: vi.fn(), stat: statMock })) -vi.mock('./discovery', async (importOriginal) => { - const actual = await importOriginal() - return { - ...actual, - getWarpThemeDirectories: getWarpThemeDirectoriesMock - } -}) - vi.mock('./parser-runner', () => ({ parseWarpThemeYamlWithTimeout: parseWarpThemeYamlWithTimeoutMock })) @@ -47,88 +35,13 @@ terminal_colors: black: '#000000' ` -function fileEntry(name: string) { - return { - name, - isFile: () => true, - isDirectory: () => false, - isSymbolicLink: () => false - } -} - -function mockDirectory( - entries: { - name: string - isFile: () => boolean - isDirectory: () => boolean - isSymbolicLink: () => boolean - }[] -) { - return { - async *[Symbol.asyncIterator]() { - for (const entry of entries) { - yield entry - } - } - } -} - -function mockStat(filePath: string) { - return filePath.endsWith('themes') - ? { isDirectory: () => true } - : { isFile: () => true, size: VALID_THEME.length } -} - describe('previewWarpThemeImport', () => { beforeEach(() => { vi.clearAllMocks() - getWarpThemeDirectoriesMock.mockReturnValue(['/Users/alice/.warp/themes']) - statMock.mockImplementation(mockStat) - readFileMock.mockResolvedValue(VALID_THEME) - realpathMock.mockImplementation((filePath: string) => Promise.resolve(filePath)) - opendirMock.mockResolvedValue(mockDirectory([fileEntry('z.yml'), fileEntry('a.yml')])) + statMock.mockResolvedValue({ isFile: () => true, size: VALID_THEME.length }) parseWarpThemeYamlWithTimeoutMock.mockImplementation(parseWarpThemeYaml) }) - it('keeps scanning later directories for unique themes after duplicate canonical files', async () => { - const stableDirectory = '/Users/alice/.warp/themes' - const previewDirectory = '/Users/alice/.warp-preview/themes' - getWarpThemeDirectoriesMock.mockReturnValue([stableDirectory, previewDirectory]) - opendirMock.mockImplementation((directoryPath: string) => { - if (directoryPath === stableDirectory) { - return Promise.resolve( - mockDirectory( - Array.from({ length: 199 }, (_, index) => fileEntry(`stable-${index}.yaml`)) - ) - ) - } - if (directoryPath === previewDirectory) { - return Promise.resolve( - mockDirectory([ - fileEntry('duplicate-a.yaml'), - fileEntry('duplicate-b.yaml'), - fileEntry('unique.yaml') - ]) - ) - } - return Promise.resolve(mockDirectory([])) - }) - realpathMock.mockImplementation((filePath: string) => { - if (filePath.endsWith('duplicate-a.yaml')) { - return Promise.resolve(path.join(stableDirectory, 'stable-0.yaml')) - } - if (filePath.endsWith('duplicate-b.yaml')) { - return Promise.resolve(path.join(stableDirectory, 'stable-1.yaml')) - } - return Promise.resolve(filePath) - }) - - const preview = await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(preview.themes).toHaveLength(200) - expect(readFileMock).toHaveBeenCalledWith(path.join(previewDirectory, 'unique.yaml'), 'utf-8') - }) - it('keeps same-basename manual file ids stable independent of dialog order', async () => { const firstPath = path.join('/Users/alice/light', 'duplicate.yaml') const secondPath = path.join('/Users/alice/dark', 'duplicate.yaml') @@ -158,23 +71,4 @@ describe('previewWarpThemeImport', () => { expect(ids.join(' ')).not.toContain('/Users/alice') expect(ids.every((id) => id.startsWith('warp:duplicate:duplicate-yaml-'))).toBe(true) }) - - it('stops streaming a large folder after the entry budget', async () => { - const yieldedNames: string[] = [] - opendirMock.mockResolvedValue({ - async *[Symbol.asyncIterator]() { - for (let index = 0; index < 1000; index += 1) { - const name = `theme-${index}.yaml` - yieldedNames.push(name) - yield fileEntry(name) - } - } - }) - - await previewWarpThemeImport({} as Store, { kind: 'auto' }) - - expect(yieldedNames).toHaveLength(501) - expect(yieldedNames).not.toContain('theme-501.yaml') - expect(yieldedNames).not.toContain('theme-999.yaml') - }) }) diff --git a/src/main/warp-themes/parser-runner.test.ts b/src/main/warp-themes/parser-runner.test.ts deleted file mode 100644 index c6362b8ce7d..00000000000 --- a/src/main/warp-themes/parser-runner.test.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -const workerState = vi.hoisted(() => ({ - instances: [] as { - terminated: boolean - workerData: unknown - listeners: Map void> - emit: (event: string, arg?: unknown) => void - terminate: () => Promise - removeAllListeners: () => void - }[] -})) - -vi.mock('electron', () => ({ - app: { isPackaged: false } -})) - -vi.mock('worker_threads', () => ({ - Worker: class MockWorker { - terminated = false - workerData: unknown - listeners = new Map void>() - - constructor(_workerPath: string, options: { workerData?: unknown }) { - this.workerData = options.workerData - workerState.instances.push(this) - } - - once(event: string, listener: (arg?: unknown) => void): this { - this.listeners.set(event, listener) - return this - } - - removeAllListeners(): void { - this.listeners.clear() - } - - async terminate(): Promise { - this.terminated = true - return 0 - } - - emit(event: string, arg?: unknown): void { - this.listeners.get(event)?.(arg) - } - } -})) - -import { parseWarpThemeYamlWithTimeout, WARP_THEME_PARSE_TIMEOUT_MS } from './parser-runner' - -describe('parseWarpThemeYamlWithTimeout', () => { - beforeEach(() => { - vi.useFakeTimers() - workerState.instances.length = 0 - }) - - afterEach(() => { - vi.useRealTimers() - }) - - it('returns worker parser results', async () => { - const resultPromise = parseWarpThemeYamlWithTimeout('name: Test', 'test.yaml') - const worker = workerState.instances[0] - worker?.emit('message', { ok: false, reason: 'Invalid YAML' }) - - await expect(resultPromise).resolves.toEqual({ ok: false, reason: 'Invalid YAML' }) - expect(worker?.terminated).toBe(false) - }) - - it('terminates the worker when parsing exceeds the budget', async () => { - const resultPromise = parseWarpThemeYamlWithTimeout('name: Slow', 'slow.yaml') - const worker = workerState.instances[0] - - await vi.advanceTimersByTimeAsync(WARP_THEME_PARSE_TIMEOUT_MS) - - await expect(resultPromise).resolves.toEqual({ - ok: false, - reason: 'Theme file took too long to parse.' - }) - expect(worker?.terminated).toBe(true) - }) - - it('uses the shorter operation-budget timeout when provided', async () => { - const resultPromise = parseWarpThemeYamlWithTimeout( - 'name: Slow', - 'slow.yaml', - {}, - { - timeoutMs: 25 - } - ) - const worker = workerState.instances[0] - - await vi.advanceTimersByTimeAsync(24) - expect(worker?.terminated).toBe(false) - - await vi.advanceTimersByTimeAsync(1) - - await expect(resultPromise).resolves.toEqual({ - ok: false, - reason: 'Theme file took too long to parse.' - }) - expect(worker?.terminated).toBe(true) - }) -}) diff --git a/src/main/warp-themes/parser.test.ts b/src/main/warp-themes/parser.test.ts deleted file mode 100644 index 33189997a25..00000000000 --- a/src/main/warp-themes/parser.test.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { afterEach, describe, expect, it, vi } from 'vitest' -import { parseWarpThemeYaml } from './parser' - -const VALID_THEME = ` -name: Tokyo Night -accent: '#7aa2f7' -background: '#1a1b26' -foreground: '#c0caf5' -cursor: '#c0caf5' -details: darker -terminal_colors: - normal: - black: '#15161e' - red: '#f7768e' - green: '#9ece6a' - yellow: '#e0af68' - blue: '#7aa2f7' - magenta: '#bb9af7' - cyan: '#7dcfff' - white: '#a9b1d6' - bright: - black: '#414868' - red: '#f7768e' - green: '#9ece6a' - yellow: '#e0af68' - blue: '#7aa2f7' - magenta: '#bb9af7' - cyan: '#7dcfff' - white: '#c0caf5' -` - -describe('parseWarpThemeYaml', () => { - afterEach(() => { - vi.restoreAllMocks() - }) - - it('maps Warp normal and bright palettes to Orca terminal colors', () => { - const result = parseWarpThemeYaml(VALID_THEME, 'tokyo_night.yaml', { - importedAt: '2026-06-05T00:00:00.000Z', - sourceLabel: 'themes' - }) - - expect(result.ok).toBe(true) - if (!result.ok) { - return - } - expect(result.theme).toMatchObject({ - id: 'warp:tokyo-night', - selectionValue: 'custom:warp:tokyo-night', - name: 'Tokyo Night', - source: 'warp', - mode: 'dark', - importedAt: '2026-06-05T00:00:00.000Z', - sourceLabel: 'themes' - }) - expect(result.theme.terminal).toMatchObject({ - background: '#1a1b26', - foreground: '#c0caf5', - cursor: '#c0caf5', - black: '#15161e', - red: '#f7768e', - brightBlack: '#414868', - brightWhite: '#c0caf5' - }) - }) - - it('uses a gradient endpoint as the terminal background', () => { - const result = parseWarpThemeYaml( - VALID_THEME.replace( - "background: '#1a1b26'", - 'background:\n top: "#002633"\n bottom: "#000000"' - ).replace("accent: '#7aa2f7'", 'accent:\n left: "#007972"\n right: "#7b008f"'), - 'cyber-wave.yaml' - ) - - expect(result.ok).toBe(true) - if (result.ok) { - expect(result.theme.terminal.background).toBe('#002633') - expect(result.theme.unsupportedFeatures).toEqual([ - 'background gradient not supported', - 'accent gradient not supported' - ]) - } - }) - - it('rejects non-object or unusable themes', () => { - expect(parseWarpThemeYaml('- one\n- two', 'list.yaml')).toEqual({ - ok: false, - reason: 'Theme file must contain a YAML object.' - }) - const partial = parseWarpThemeYaml( - 'background: "#000000"\nforeground: "#ffffff"', - 'partial.yaml' - ) - expect(partial.ok).toBe(false) - }) -}) diff --git a/src/main/warp-themes/theme-file-scanner.test.ts b/src/main/warp-themes/theme-file-scanner.test.ts deleted file mode 100644 index 9e15b964044..00000000000 --- a/src/main/warp-themes/theme-file-scanner.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { mkdir, mkdtemp, readdir, rm, writeFile } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import path from 'node:path' -import { expect, it, vi } from 'vitest' -import { scanWarpThemeDirectory } from './theme-file-scanner' - -it('reuses one collator per directory while preserving capped scan order', async () => { - const directory = await mkdtemp(path.join(tmpdir(), 'orca-theme-order-')) - const names = ['éclair', 'item2', 'item10', 'Ångström', 'zebra', 'İstanbul'] - try { - await Promise.all(names.map((name) => writeFile(path.join(directory, `${name}.yaml`), ''))) - await mkdir(path.join(directory, 'nested')) - await writeFile(path.join(directory, 'nested', 'theme.yaml'), '') - const expected = (await readdir(directory)) - // ast-grep-ignore: no-repeated-collator -- Preserve the old comparator as the parity oracle. - .sort((a, b) => a.localeCompare(b, undefined, { sensitivity: 'base' })) - .map((name) => (name === 'nested' ? path.join(name, 'theme.yaml') : name)) - const NativeCollator = Intl.Collator - const construct = vi.spyOn(Intl, 'Collator').mockImplementation(function (locales, options) { - return new NativeCollator(locales, options) - }) - const localeCompare = vi.spyOn(String.prototype, 'localeCompare') - try { - const result = await scanWarpThemeDirectory(directory, undefined, { themeFileLimit: 6 }) - expect(result.files.map((file) => file.label)).toEqual(expected.slice(0, 6)) - expect(result.themeFileLimitHit).toBe(true) - expect(construct).toHaveBeenCalledExactlyOnceWith(undefined, { sensitivity: 'base' }) - expect(localeCompare).not.toHaveBeenCalled() - } finally { - vi.restoreAllMocks() - } - } finally { - await rm(directory, { recursive: true, force: true }) - } -}) diff --git a/src/shared/github/accounts/account-binding.test.ts b/src/shared/github/accounts/account-binding.test.ts deleted file mode 100644 index 7d68b80fa83..00000000000 --- a/src/shared/github/accounts/account-binding.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { ghTokenEnvVarForHost } from './account-binding' - -describe('ghTokenEnvVarForHost', () => { - it('selects GH_TOKEN for github.com, github.localhost, and *.ghe.com', () => { - expect(ghTokenEnvVarForHost('github.com')).toBe('GH_TOKEN') - expect(ghTokenEnvVarForHost('github.localhost')).toBe('GH_TOKEN') - expect(ghTokenEnvVarForHost('acme.ghe.com')).toBe('GH_TOKEN') - }) - - it('selects GH_ENTERPRISE_TOKEN for classic GHES hosts', () => { - expect(ghTokenEnvVarForHost('github.acme-corp.com')).toBe('GH_ENTERPRISE_TOKEN') - expect(ghTokenEnvVarForHost('ghe.internal')).toBe('GH_ENTERPRISE_TOKEN') - }) -}) diff --git a/src/shared/kiro-home.test.ts b/src/shared/kiro-home.test.ts deleted file mode 100644 index e13a2d24b00..00000000000 --- a/src/shared/kiro-home.test.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { homedir } from 'node:os' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' -import { resolveKiroHomeDir } from './kiro-home' - -describe('resolveKiroHomeDir', () => { - it('ignores a relative KIRO_HOME, which would resolve against Orca’s cwd', () => { - expect(resolveKiroHomeDir({ KIRO_HOME: 'relative/kiro' })).toBe(join(homedir(), '.kiro')) - }) -}) diff --git a/src/shared/nvm-default-alias.test.ts b/src/shared/nvm-default-alias.test.ts index f3003ad3cd1..d4cc4680e4d 100644 --- a/src/shared/nvm-default-alias.test.ts +++ b/src/shared/nvm-default-alias.test.ts @@ -77,11 +77,6 @@ describe('nvm default alias decides the seeded runtime', () => { } ) - it('falls back to newest when the default names an uninstalled version', () => { - const home = makeNvmHome({ versions: ['v24.18.0', 'v26.7.0'], defaultAlias: '18' }) - expect(seededNvmDir(home)).toBe(join(home, '.nvm', 'versions', 'node', 'v26.7.0', 'bin')) - }) - it('survives a cyclic alias chain instead of hanging', () => { const home = makeNvmHome({ versions: ['v24.18.0', 'v26.7.0'], @@ -91,34 +86,6 @@ describe('nvm default alias decides the seeded runtime', () => { expect(seededNvmDir(home)).toBe(join(home, '.nvm', 'versions', 'node', 'v26.7.0', 'bin')) }) - // Digit-leading 0x18/00 also coerce to zero with parseInt; nvm persists nonexistent aliases but resolves them as N/A. - it.each([ - 'garbage', - 'iojs', - 'lts/nonexistent', - 'my-custom-alias', - '0x18', - '00', - '0abc', - '024', - '24abc', - 'v24.18.0-nightly', - 'V24' - ])('treats the unresolvable default %s as no preference, like nvm N/A', (token) => { - // Unparseable aliases previously coerced to [0], selecting this v0.12.7 sentinel. - const home = makeNvmHome({ - versions: ['v0.12.7', 'v24.18.0', 'v26.7.0'], - defaultAlias: token - }) - expect(seededNvmDir(home)).toBe(join(home, '.nvm', 'versions', 'node', 'v26.7.0', 'bin')) - }) - - it('still treats a numeric default as a version prefix, matching nvm', () => { - // Reject malformed aliases while retaining nvm’s valid numeric prefix 0 → installed v0.x. - const home = makeNvmHome({ versions: ['v0.12.7', 'v24.18.0'], defaultAlias: '0' }) - expect(seededNvmDir(home)).toBe(join(home, '.nvm', 'versions', 'node', 'v0.12.7', 'bin')) - }) - it('still finds a CLI that lives outside the default version', () => { // Default-first is preference only; retain other installed versions as CLI fallbacks. const home = makeNvmHome({ diff --git a/src/shared/plugins/artifacts/plugin-vm-recipe-artifact.test.ts b/src/shared/plugins/artifacts/plugin-vm-recipe-artifact.test.ts deleted file mode 100644 index 8839c85fa6d..00000000000 --- a/src/shared/plugins/artifacts/plugin-vm-recipe-artifact.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { parsePluginVmRecipeArtifact } from './plugin-vm-recipe-artifact' - -describe('plugin VM recipe artifacts', () => { - it('represents an explicitly disabled destroy action without executing text', () => { - const recipe = parsePluginVmRecipeArtifact( - JSON.stringify({ - schemaVersion: 1, - id: 'managed', - name: 'Managed', - create: 'create', - destroy: 'none' - }) - ) - - expect(recipe).toMatchObject({ destroyDisabled: true }) - expect(recipe.destroy).toBeUndefined() - }) -}) diff --git a/src/shared/preferred-git-remote.test.ts b/src/shared/preferred-git-remote.test.ts deleted file mode 100644 index 4a95fac41b3..00000000000 --- a/src/shared/preferred-git-remote.test.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { pickPreferredGitRemote } from './preferred-git-remote' - -describe('pickPreferredGitRemote', () => { - it('refuses to guess between multiple non-origin remotes', () => { - expect(() => pickPreferredGitRemote(['fork', 'upstream'])).toThrow( - 'Repo has multiple remotes (fork, upstream) and no default is configured.' - ) - }) -}) diff --git a/src/shared/rpc-contract/terminal/terminal-create-shell-param.test.ts b/src/shared/rpc-contract/terminal/terminal-create-shell-param.test.ts deleted file mode 100644 index b19a9ee4751..00000000000 --- a/src/shared/rpc-contract/terminal/terminal-create-shell-param.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { TerminalCreateParams } from './terminal-unary-params' - -describe('TerminalCreateParams.shell', () => { - // Host canonicalization must supply the .exe spellings exact-matched by spawn and command quoting. - it('canonicalizes an accepted spelling before it reaches the runtime', () => { - expect(TerminalCreateParams.parse({ worktree: 'path:/repo', shell: 'cmd' }).shell).toBe( - 'cmd.exe' - ) - expect(TerminalCreateParams.parse({ worktree: 'path:/repo', shell: 'pwsh' }).shell).toBe( - 'pwsh.exe' - ) - expect(TerminalCreateParams.parse({ worktree: 'path:/repo', shell: 'Git-Bash' }).shell).toBe( - 'git-bash' - ) - }) -}) diff --git a/src/shared/workspace-layout/tab-groups/tab-order-moves.test.ts b/src/shared/workspace-layout/tab-groups/tab-order-moves.test.ts deleted file mode 100644 index ec2bccf8a6f..00000000000 --- a/src/shared/workspace-layout/tab-groups/tab-order-moves.test.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { tabOrderMoves } from './tab-order' - -describe('tabOrderMoves', () => { - it('is one move when one tab moved, either way', () => { - expect(tabOrderMoves(['a', 'b', 'c', 'd'], ['b', 'c', 'a', 'd'])).toEqual([ - { tabId: 'a', index: 2 } - ]) - expect(tabOrderMoves(['a', 'b', 'c', 'd'], ['a', 'd', 'b', 'c'])).toEqual([ - { tabId: 'd', index: 1 } - ]) - }) -})