test: update worktree test to match new tea pr create procedure

tea pr create should run from main repo dir instead of using --repo flag,
because tea cannot detect repo from worktree .git files.
This commit is contained in:
2026-05-30 14:24:33 +08:00
parent d54d448585
commit f12b60385a
2 changed files with 5 additions and 12 deletions
@@ -24,7 +24,7 @@ describe("solve-issue workflow: tea pr create worktree fix", () => {
"solve-issue.yaml",
);
test("committer procedure should include --repo flag in tea pr create command", async () => {
test("committer procedure should require running tea pr create from main repo directory", async () => {
const yamlContent = await readFile(workflowPath, "utf-8");
const workflow = parse(yamlContent) as WorkflowPayload;
@@ -32,19 +32,12 @@ describe("solve-issue workflow: tea pr create worktree fix", () => {
const committerProcedure = workflow.roles.committer?.procedure;
expect(committerProcedure).toBeDefined();
// Verify the procedure includes tea pr create with --repo flag
// Verify the procedure includes tea pr create
expect(committerProcedure).toContain("tea pr create");
expect(committerProcedure).toContain("--repo");
// Verify the --repo flag appears before or together with tea pr create
// This ensures the command is: tea pr create --repo <owner/repo> ...
const teaPrCreateMatch = committerProcedure?.match(/tea pr create[^\n]*/);
expect(teaPrCreateMatch).not.toBeNull();
if (teaPrCreateMatch) {
const teaCommandLine = teaPrCreateMatch[0];
expect(teaCommandLine).toContain("--repo");
}
// Verify the procedure warns about running from main repo dir (not worktree)
expect(committerProcedure).toMatch(/main repo directory/i);
expect(committerProcedure).toMatch(/not a worktree/i);
});
test("committer procedure should mention repo extraction from git remote", async () => {
View File