Files
kandev/apps/web/components/task-create-dialog-executor-wait.test.ts
T
Carlos Florêncio b9eb6ae058 refactor(web): remove legacy settings migration (#1704)
* refactor(web): remove legacy settings migration

* fix(web): hydrate portable settings from boot state

* fix(web): preserve sidebar sync contracts

* fix(web): retain portable settings filters

* fix(web): retry sidebar settings writes

* fix(web): retain sidebar boot settings

* fix(websocket): avoid shutdown teardown leaks

* fix(boot): normalize sidebar task preferences

* fix(settings): preserve saved views during hydration

* fix(jira): avoid duplicate saved-view syncs

* fix(jira): preserve saved views on fetch failure

* fix(jira): retry saved-view hydration failures

* refactor(jira): simplify hydration request cleanup

* fix(websocket): close late clients after hub shutdown
2026-07-16 00:06:41 +01:00

40 lines
1.3 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { shouldWaitForLastUsedExecutorProfile } from "./task-create-dialog-effects";
import type { StoreSelections } from "@/components/task-create-dialog-types";
const WORKTREE_EXECUTOR_ID = "exec-worktree";
const WORKTREE_PROFILE_ID = "profile-b";
function makeWorktreeExecutor(): StoreSelections["executors"][number] {
return {
id: WORKTREE_EXECUTOR_ID,
type: "worktree",
profiles: [{ id: WORKTREE_PROFILE_ID, executor_id: WORKTREE_EXECUTOR_ID, name: "B" }],
} as unknown as StoreSelections["executors"][number];
}
describe("shouldWaitForLastUsedExecutorProfile", () => {
it("waits only while a valid last-used executor profile can restore", () => {
const worktreeExecutor = makeWorktreeExecutor();
expect(
shouldWaitForLastUsedExecutorProfile({
executors: [worktreeExecutor],
workspaceDefaults: null,
lastUsedExecutorProfileId: WORKTREE_PROFILE_ID,
noRepository: false,
preferLocalExecutor: false,
}),
).toBe(true);
expect(
shouldWaitForLastUsedExecutorProfile({
executors: [worktreeExecutor],
workspaceDefaults: null,
lastUsedExecutorProfileId: "missing-profile",
noRepository: false,
preferLocalExecutor: false,
}),
).toBe(false);
});
});