fix(web): keep repository tasks on worktree defaults (#2136)
This commit is contained in:
@@ -4,6 +4,8 @@ import type { StoreSelections } from "@/components/task-create-dialog-types";
|
||||
|
||||
const WORKTREE_EXECUTOR_ID = "exec-worktree";
|
||||
const WORKTREE_PROFILE_ID = "profile-b";
|
||||
const LOCAL_EXECUTOR_ID = "exec-local";
|
||||
const LOCAL_PROFILE_ID = "profile-local";
|
||||
|
||||
function makeWorktreeExecutor(): StoreSelections["executors"][number] {
|
||||
return {
|
||||
@@ -13,6 +15,14 @@ function makeWorktreeExecutor(): StoreSelections["executors"][number] {
|
||||
} as unknown as StoreSelections["executors"][number];
|
||||
}
|
||||
|
||||
function makeLocalExecutor(): StoreSelections["executors"][number] {
|
||||
return {
|
||||
id: LOCAL_EXECUTOR_ID,
|
||||
type: "local",
|
||||
profiles: [{ id: LOCAL_PROFILE_ID, executor_id: LOCAL_EXECUTOR_ID, name: "Local" }],
|
||||
} as unknown as StoreSelections["executors"][number];
|
||||
}
|
||||
|
||||
describe("shouldWaitForLastUsedExecutorProfile", () => {
|
||||
it("waits only while a valid last-used executor profile can restore", () => {
|
||||
const worktreeExecutor = makeWorktreeExecutor();
|
||||
@@ -36,4 +46,16 @@ describe("shouldWaitForLastUsedExecutorProfile", () => {
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("does not wait for a valid profile from another resolved executor", () => {
|
||||
expect(
|
||||
shouldWaitForLastUsedExecutorProfile({
|
||||
executors: [makeLocalExecutor(), makeWorktreeExecutor()],
|
||||
workspaceDefaults: null,
|
||||
lastUsedExecutorProfileId: LOCAL_PROFILE_ID,
|
||||
noRepository: false,
|
||||
preferLocalExecutor: false,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user