Files
orca/src/shared/quick-open-expansion-paths.test.ts
T
c5669cceb5 fix(quick-open): prune generated dirs in git fallback (#7842)
* fix(quick-open): prune generated dirs in git fallback

* fix(source-control): narrow manual review provider switch

* fix(quick-open): collapse git fallback directories

Co-authored-by: Orca <help@stably.ai>

* fix(quick-open): harden collapsed git directory expansion

Co-authored-by: Orca <help@stably.ai>

* fix(quick-open): close directory expansion races

Co-authored-by: Orca <help@stably.ai>

* perf(quick-open): collapse placeholders efficiently

Co-authored-by: Orca <help@stably.ai>

* fix(quick-open): preserve root and cancellation semantics

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-07-10 03:06:44 -07:00

27 lines
806 B
TypeScript

import { describe, expect, it } from 'vitest'
import { collapseQuickOpenExpansionPaths } from './quick-open-expansion-paths'
describe('collapseQuickOpenExpansionPaths', () => {
it('collapses descendants without confusing shared-prefix siblings', () => {
const paths = new Map<string, boolean>([
['foo/bar/deep', false],
['foo-sibling', false],
['foo', false],
['foo/bar', true]
])
expect(collapseQuickOpenExpansionPaths(paths)).toEqual([
['foo', true],
['foo-sibling', false]
])
})
it('keeps many sibling placeholders distinct', () => {
const paths = new Map(
Array.from({ length: 10_001 }, (_, index) => [`generated-${index}`, true] as const)
)
expect(collapseQuickOpenExpansionPaths(paths)).toHaveLength(paths.size)
})
})