mirror of
https://github.com/getpaseo/paseo.git
synced 2026-08-14 20:32:46 +00:00
Drops the per-test manual boilerplate (connectWorkspaceSetupClient, createTempGitRepo, seedProjectForWorkspaceSetup, openProject, openHomeWithProject, navigateToWorkspaceViaSidebar, try/finally cleanup) in favour of the withWorkspace fixture landed in #717. Both tests — main checkout and worktree — verified green locally.
45 lines
1.6 KiB
TypeScript
45 lines
1.6 KiB
TypeScript
import { expect, test } from "./fixtures";
|
|
import { clickTerminal } from "./helpers/launcher";
|
|
import { setupDeterministicPrompt, waitForTerminalContent } from "./helpers/terminal-perf";
|
|
|
|
test.describe("Workspace cwd correctness", () => {
|
|
test("main checkout workspace opens terminals in the project root", async ({
|
|
page,
|
|
withWorkspace,
|
|
}) => {
|
|
test.setTimeout(60_000);
|
|
|
|
const workspace = await withWorkspace({ prefix: "workspace-cwd-main-" });
|
|
await workspace.navigateTo();
|
|
await clickTerminal(page);
|
|
|
|
const terminal = page.locator('[data-testid="terminal-surface"]');
|
|
await expect(terminal.first()).toBeVisible({ timeout: 20_000 });
|
|
await terminal.first().click();
|
|
|
|
await setupDeterministicPrompt(page, `PWD_READY_${Date.now()}`);
|
|
await terminal.first().pressSequentially("pwd\n", { delay: 0 });
|
|
|
|
await waitForTerminalContent(page, (text) => text.includes(workspace.repoPath), 10_000);
|
|
});
|
|
|
|
test("worktree workspace opens terminals in the worktree directory", async ({
|
|
page,
|
|
withWorkspace,
|
|
}) => {
|
|
test.setTimeout(90_000);
|
|
|
|
const workspace = await withWorkspace({ worktree: true, prefix: "workspace-cwd-worktree-" });
|
|
await workspace.navigateTo();
|
|
await clickTerminal(page);
|
|
|
|
const terminal = page.locator('[data-testid="terminal-surface"]');
|
|
await expect(terminal.first()).toBeVisible({ timeout: 20_000 });
|
|
await terminal.first().click();
|
|
|
|
await setupDeterministicPrompt(page, `PWD_READY_${Date.now()}`);
|
|
await terminal.first().pressSequentially("pwd\n", { delay: 0 });
|
|
await waitForTerminalContent(page, (text) => text.includes(workspace.repoPath), 10_000);
|
|
});
|
|
});
|