fix(e2e): submit creation form in new-workspace test

clickNewWorkspaceButton now completes the full user flow: after
clicking the sidebar button, waits for the /new route, then clicks
the Create button to submit the empty form and trigger workspace
creation + redirect.
This commit is contained in:
Mohamed Boudra
2026-04-14 11:54:15 +07:00
parent 74a65bd851
commit d888da8591
@@ -164,6 +164,14 @@ export async function clickNewWorkspaceButton(
const button = page.getByTestId(`sidebar-project-new-worktree-${input.projectKey}`).first();
await expect(button).toBeVisible({ timeout: 30_000 });
await button.click();
await expect(page).toHaveURL(/\/h\/[^/]+\/new(?:\?.*)?$/, {
timeout: 30_000,
});
const createButton = page.getByRole("button", { name: "Create" });
await expect(createButton).toBeVisible({ timeout: 30_000 });
await createButton.click();
}
export async function assertNewWorkspaceSidebarAndHeader(