Skip to content

Commit 68845a1

Browse files
simionclaude
andcommitted
test(e2e): require the new-task menu to exist before calling it settled
The shared `settleMenuMode` helper read the menu's text and compared `includes("Branch from")` against the mode. For main-checkout that wants FALSE — which an empty string satisfies, so the wait passed while the menu was briefly not in the DOM at all, and the click landed in Radix's remount. That is the `!!m` guard 5eff3f3 added for this exact case and my refactor dropped; "prompts for a name before creating a main-checkout Terminal task" then failed in CI the way its worktree sibling used to. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F2JzhUsFa9YLjBBvUJQGYj
1 parent d76c951 commit 68845a1

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

e2e/specs/projects.e2e.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,15 @@ describe("branch new tasks from", () => {
345345
const settleMenuMode = async (mode: "worktree" | "main") => {
346346
const wantsBranchFrom = mode === "worktree";
347347
await browser.waitUntil(
348-
async () => (await menuText()).includes("Branch from") === wantsBranchFrom,
348+
async () => {
349+
const text = await menuText();
350+
// The menu must EXIST, not merely lack the row. Radix remounts the
351+
// content while the mode flips, so there is a beat where the query
352+
// finds nothing — and "" trivially satisfies "no Branch from row",
353+
// which let the main-checkout case settle on a menu that was not
354+
// there yet and click into the remount.
355+
return text.length > 0 && text.includes("Branch from") === wantsBranchFrom;
356+
},
349357
{ timeout: 8_000, timeoutMsg: `the menu never settled into ${mode} mode` },
350358
);
351359
};

0 commit comments

Comments
 (0)