Skip to content
Source
Sign inSign up

projectThreadCreationValidation.test.ts

25 lines771 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { resolveProjectThreadCreationBranch } from "./projectThreadCreationValidation";
4​
5describe("resolveProjectThreadCreationBranch", () => {
6 it("uses the live checkout for an untouched local draft label and recorded branch", () => {
7 expect(
8 resolveProjectThreadCreationBranch({
9 workspaceMode: "local",
10 selectedBranch: null,
11 currentCheckoutBranch: "feature/x",
12 }),
13 ).toBe("feature/x");
14 });
15​
16 it("never borrows the current checkout for a worktree draft", () => {
17 expect(
18 resolveProjectThreadCreationBranch({
19 workspaceMode: "worktree",
20 selectedBranch: null,
21 currentCheckoutBranch: "feature/x",
22 }),
23 ).toBeNull();
24 });
25});