mirror of
https://github.com/stablyai/orca.git
synced 2026-10-17 16:02:55 +00:00
* fix: avoid repeated macos privacy prompts * fix: reduce background worktree permission probes * chore: pin oxlint for ci * fix: preserve optional rpc params with zod 4.4 * fix: preserve optional inline rpc params with zod 4.4
55 lines
1.4 KiB
TypeScript
55 lines
1.4 KiB
TypeScript
import { describe, expect, it, vi } from 'vitest'
|
|
import { loadKnownUsageWorktreesByRepo } from './usage-worktree-metadata'
|
|
|
|
describe('loadKnownUsageWorktreesByRepo', () => {
|
|
it('builds usage worktree refs from repo roots and persisted metadata', () => {
|
|
const store = {
|
|
getAllWorktreeMeta: vi.fn(() => ({
|
|
'repo-1::/workspace/repo-a-feature': {
|
|
displayName: 'Feature A'
|
|
},
|
|
'repo-2::/remote/repo-b-feature': {
|
|
displayName: 'Remote feature'
|
|
},
|
|
malformed: {
|
|
displayName: 'Ignored'
|
|
}
|
|
}))
|
|
}
|
|
const repos = [
|
|
{
|
|
id: 'repo-1',
|
|
path: '/workspace/repo-a',
|
|
displayName: 'Repo A'
|
|
},
|
|
{
|
|
id: 'repo-2',
|
|
path: '/remote/repo-b',
|
|
displayName: 'Remote Repo',
|
|
connectionId: 'ssh-1'
|
|
}
|
|
]
|
|
|
|
expect(loadKnownUsageWorktreesByRepo(store as never, repos as never)).toEqual(
|
|
new Map([
|
|
[
|
|
'repo-1',
|
|
[
|
|
{
|
|
worktreeId: 'repo-1::/workspace/repo-a',
|
|
path: '/workspace/repo-a',
|
|
displayName: 'Repo A'
|
|
},
|
|
{
|
|
worktreeId: 'repo-1::/workspace/repo-a-feature',
|
|
path: '/workspace/repo-a-feature',
|
|
displayName: 'Feature A'
|
|
}
|
|
]
|
|
]
|
|
])
|
|
)
|
|
expect(store.getAllWorktreeMeta).toHaveBeenCalledTimes(1)
|
|
})
|
|
})
|