From 3e02c4bbb154fb1e417419db7b2fa1ab04cc3c35 Mon Sep 17 00:00:00 2001 From: OrcaWin <293788423+OrcaWin@users.noreply.github.com> Date: Thu, 12 Nov 2026 11:19:43 -0800 Subject: [PATCH] test: remove unused comparator coverage and orphan fixtures --- .../skills/install/skill-installation.test.ts | 18 ------- .../logs/check-job-log-captured-fixture.ts | 13 ----- .../tab-bar/lucide-icon-stub-fixture.ts | 10 ---- .../keyboard/xterm-bypass-event-fixture.ts | 16 ------- .../node-source-copy-content-equality.test.ts | 48 ------------------- 5 files changed, 105 deletions(-) delete mode 100644 src/renderer/src/components/right-sidebar/checks-panel/logs/check-job-log-captured-fixture.ts delete mode 100644 src/renderer/src/components/tab-bar/lucide-icon-stub-fixture.ts delete mode 100644 src/renderer/src/components/terminal-pane/input/keyboard/xterm-bypass-event-fixture.ts delete mode 100644 src/shared/file-content/node-source-copy-content-equality.test.ts diff --git a/src/main/skills/install/skill-installation.test.ts b/src/main/skills/install/skill-installation.test.ts index 4390dd339b9..43886af7c4e 100644 --- a/src/main/skills/install/skill-installation.test.ts +++ b/src/main/skills/install/skill-installation.test.ts @@ -27,24 +27,6 @@ describe('skill install service', () => { expect(await readFile(join(claude, 'SKILL.md'), 'utf8')).toBe('unowned') }) - it('removes an owned placement when its provider is deselected', async () => { - const { root, input } = await createSkillInstallHome() - await installSharedSkill(input) - const claude = join(root, 'home', '.claude', 'skills', 'test-skill') - - const updated = await installSharedSkill({ - ...input, - operationId: 'operation_without_claude', - detectedProviders: ['codex'] - }) - - expect(updated.status).toBe('unchanged') - await expect(lstat(claude)).rejects.toMatchObject({ code: 'ENOENT' }) - expect(updated.placements).toEqual([ - expect.objectContaining({ provider: 'agent-skills', topology: 'canonical-copy' }) - ]) - }) - it('preserves the committed canonical install when cancellation reaches provider placement', async () => { const { root, input } = await createSkillInstallHome() const controller = new AbortController() diff --git a/src/renderer/src/components/right-sidebar/checks-panel/logs/check-job-log-captured-fixture.ts b/src/renderer/src/components/right-sidebar/checks-panel/logs/check-job-log-captured-fixture.ts deleted file mode 100644 index f247088c132..00000000000 --- a/src/renderer/src/components/right-sidebar/checks-panel/logs/check-job-log-captured-fixture.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { createCheckLogFixture } from '../../../../../../../config/scripts/performance/check-job-log/check-job-log-test-fixture.mjs' -import { sliceCheckLogTail } from '../../../../../../shared/source-control/checks/logs/check-job-log-tail-slice' - -export const capturedCheckLogFailure = createCheckLogFixture() - -export const capturedCheckLogExcerpt = sliceCheckLogTail(capturedCheckLogFailure.rawLog) -export const capturedCheckLogFrame = capturedCheckLogExcerpt - .split('\n') - .find((line) => line.includes(capturedCheckLogFailure.expectedStackFrame)) - -if (!capturedCheckLogFrame) { - throw new Error('Captured check log is missing its expected complete frame') -} diff --git a/src/renderer/src/components/tab-bar/lucide-icon-stub-fixture.ts b/src/renderer/src/components/tab-bar/lucide-icon-stub-fixture.ts deleted file mode 100644 index 823ccc43526..00000000000 --- a/src/renderer/src/components/tab-bar/lucide-icon-stub-fixture.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Use a proxy because tab activation reaches sidebar icons beyond each test’s direct imports. - -export function stubEveryIcon(): Record { - const Icon = (): null => null - const isIconKey = (key: string | symbol): boolean => typeof key === 'string' && key !== 'then' - return new Proxy({} as Record, { - get: (_target, key) => (isIconKey(key) ? Icon : undefined), - has: (_target, key) => isIconKey(key) - }) -} diff --git a/src/renderer/src/components/terminal-pane/input/keyboard/xterm-bypass-event-fixture.ts b/src/renderer/src/components/terminal-pane/input/keyboard/xterm-bypass-event-fixture.ts deleted file mode 100644 index aa55951833f..00000000000 --- a/src/renderer/src/components/terminal-pane/input/keyboard/xterm-bypass-event-fixture.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { XtermBypassEvent } from './xterm-bypass-policy' - -// Keep bypass/IME suites aligned with the complete XtermBypassEvent shape. -export function event(overrides: Partial): XtermBypassEvent { - return { - type: 'keydown', - key: '', - code: '', - defaultPrevented: false, - metaKey: false, - ctrlKey: false, - altKey: false, - shiftKey: false, - ...overrides - } -} diff --git a/src/shared/file-content/node-source-copy-content-equality.test.ts b/src/shared/file-content/node-source-copy-content-equality.test.ts deleted file mode 100644 index 0b34cfa2657..00000000000 --- a/src/shared/file-content/node-source-copy-content-equality.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { - closeSync, - mkdtempSync, - openSync, - rmSync, - truncateSync, - writeFileSync, - writeSync -} from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, describe, expect, it } from 'vitest' -import { - NODE_FILE_CONTENT_COMPARE_CHUNK_BYTES, - nodeSourceAndCopyContentsEqualSync -} from './node-source-copy-content-equality' - -describe('Node source/copy content equality', () => { - const roots: string[] = [] - - afterEach(() => { - for (const root of roots.splice(0)) { - rmSync(root, { recursive: true, force: true }) - } - }) - - it('compares multi-megabyte sparse files with fixed-size chunks', () => { - const root = mkdtempSync(join(tmpdir(), 'orca-resource-compare-')) - roots.push(root) - const sourcePath = join(root, 'source.md') - const copyPath = join(root, 'copy.md') - const sparseBytes = NODE_FILE_CONTENT_COMPARE_CHUNK_BYTES * 128 - for (const path of [sourcePath, copyPath]) { - writeFileSync(path, 'same-prefix') - truncateSync(path, sparseBytes) - } - - expect(nodeSourceAndCopyContentsEqualSync(sourcePath, copyPath)).toBe(true) - - const descriptor = openSync(copyPath, 'r+') - try { - writeSync(descriptor, Buffer.from('x'), 0, 1, sparseBytes - 1) - } finally { - closeSync(descriptor) - } - expect(nodeSourceAndCopyContentsEqualSync(sourcePath, copyPath)).toBe(false) - }) -})