feat(file-explorer): add gitignored visibility toggle (#2022)

This commit is contained in:
Leynier Gutiérrez González
2026-05-17 18:33:47 -04:00
committed by GitHub
parent 0dc0995bd1
commit 231bad8e19
30 changed files with 647 additions and 69 deletions
+25
View File
@@ -1,3 +1,4 @@
/* eslint-disable max-lines -- Why: git RPC methods share one dispatcher fixture, and keeping the contract cases together makes method coverage easy to audit. */
import { describe, expect, it, vi } from 'vitest'
import { RpcDispatcher } from '../dispatcher'
import type { RpcRequest } from '../core'
@@ -54,6 +55,30 @@ describe('git RPC methods', () => {
})
})
it('returns ignored paths for selected explorer rows', async () => {
const runtime = {
getRuntimeId: () => 'test-runtime',
checkRuntimeGitIgnoredPaths: vi.fn().mockResolvedValue(['dist/bundle.js'])
} as unknown as OrcaRuntimeService
const dispatcher = new RpcDispatcher({ runtime, methods: GIT_METHODS })
const response = await dispatcher.dispatch(
makeRequest('git.checkIgnored', {
worktree: 'id:wt-1',
paths: ['dist/bundle.js', 'src/index.ts']
})
)
expect(runtime.checkRuntimeGitIgnoredPaths).toHaveBeenCalledWith('id:wt-1', [
'dist/bundle.js',
'src/index.ts'
])
expect(response).toMatchObject({
ok: true,
result: ['dist/bundle.js']
})
})
it('returns a worktree file diff', async () => {
const runtime = {
getRuntimeId: () => 'test-runtime',