Fix hidden browser automation paintability (#2851)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -7854,6 +7854,45 @@ describe('OrcaRuntimeService', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('resolves an exact path selector when duplicate repo entries expose the same path', async () => {
|
||||
const runtime = new OrcaRuntimeService(store)
|
||||
const duplicatePath = '/tmp/workspaces/runtime-duplicate-selector'
|
||||
const getRepos = vi.spyOn(store, 'getRepos').mockReturnValue([
|
||||
{
|
||||
id: TEST_REPO_ID,
|
||||
path: TEST_REPO_PATH,
|
||||
displayName: 'repo',
|
||||
badgeColor: 'blue',
|
||||
addedAt: 1
|
||||
},
|
||||
{
|
||||
id: 'repo-duplicate-entry',
|
||||
path: '/tmp/repo-secondary-worktree',
|
||||
displayName: 'repo-secondary-worktree',
|
||||
badgeColor: 'red',
|
||||
addedAt: 2
|
||||
}
|
||||
])
|
||||
vi.mocked(listWorktrees).mockResolvedValue([
|
||||
{
|
||||
path: duplicatePath,
|
||||
head: 'def',
|
||||
branch: 'runtime-duplicate-selector',
|
||||
isBare: false,
|
||||
isMainWorktree: false
|
||||
}
|
||||
])
|
||||
|
||||
try {
|
||||
const worktree = await runtime.showManagedWorktree(`path:${duplicatePath}`)
|
||||
|
||||
expect(worktree.id).toBe(`${TEST_REPO_ID}::${duplicatePath}`)
|
||||
expect(worktree.path).toBe(duplicatePath)
|
||||
} finally {
|
||||
getRepos.mockRestore()
|
||||
}
|
||||
})
|
||||
|
||||
it('keeps CLI-created worktrees successful when initial terminal creation fails', async () => {
|
||||
const runtime = new OrcaRuntimeService(store)
|
||||
const spawn = vi.fn().mockRejectedValue(new Error('pty unavailable'))
|
||||
|
||||
Reference in New Issue
Block a user