mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
b89d4ea029
* feat(marketplace): extract marketplace into standalone webview panel * fix(marketplace): correct fetchData directory arg and add error logging Replace swallowed catch block with console.warn for session status sync failures, and pass `this.directory()` instead of `project` as the second positional argument to `fetchMarketplaceData`.
23 lines
849 B
TypeScript
23 lines
849 B
TypeScript
import { describe, expect, it } from "bun:test"
|
|
import { resolvePanelProjectDirectory, resolveProjectDirectory } from "../../src/project-directory"
|
|
|
|
describe("project directory resolution", () => {
|
|
const folders = [{ uri: { fsPath: "/repo-a" } }, { uri: { fsPath: "/repo-b" } }]
|
|
|
|
it("prefers the active editor project", () => {
|
|
expect(resolvePanelProjectDirectory("/repo-b", folders)).toBe("/repo-b")
|
|
})
|
|
|
|
it("uses the only open workspace", () => {
|
|
expect(resolvePanelProjectDirectory(undefined, [folders[0]])).toBe("/repo-a")
|
|
})
|
|
|
|
it("disables project scope when a multi-root workspace is ambiguous", () => {
|
|
expect(resolvePanelProjectDirectory(undefined, folders)).toBeNull()
|
|
})
|
|
|
|
it("preserves an explicit null project override", () => {
|
|
expect(resolveProjectDirectory(null, () => "/repo-a")).toBeUndefined()
|
|
})
|
|
})
|