diff --git a/e2e/gitWorktreesLayout.spec.ts b/e2e/gitWorktreesLayout.spec.ts index b68cb07354..3b9e85a942 100644 --- a/e2e/gitWorktreesLayout.spec.ts +++ b/e2e/gitWorktreesLayout.spec.ts @@ -1,6 +1,8 @@ import { expect, stubDesktop, test } from "./fixtures"; -test("Worktrees places actions beside the tree and shows the folder above its branch", async ({ workbench: page }) => { +test("Worktrees places actions beside the tree and shows the folder, branch, and path on one row", async ({ + workbench: page, +}) => { await page.setViewportSize({ width: 1100, height: 700 }); await stubDesktop(page); await page.evaluate(async () => { @@ -42,9 +44,16 @@ test("Worktrees places actions beside the tree and shows the folder above its br const row = tree.getByRole("treeitem", { name: /review-worktree.*feature\/review/ }); const name = row.getByText("review-worktree", { exact: true }); const branch = row.getByText("feature/review", { exact: true }); + const path = row.getByText("/dev/review-worktree", { exact: true }); + await expect(path).toBeVisible(); const nameBox = (await name.boundingBox())!; const branchBox = (await branch.boundingBox())!; - expect(nameBox.y + nameBox.height).toBeLessThanOrEqual(branchBox.y); + const pathBox = (await path.boundingBox())!; + expect(nameBox.x + nameBox.width).toBeLessThanOrEqual(branchBox.x); + expect(branchBox.x + branchBox.width).toBeLessThanOrEqual(pathBox.x); + for (const column of [branchBox, pathBox]) { + expect(column.y + column.height / 2).toBeCloseTo(nameBox.y + nameBox.height / 2, 0); + } await expect(name).toHaveCSS("font-size", await branch.evaluate((el) => getComputedStyle(el).fontSize)); await expect(row.getByRole("img", { name: "locked", exact: true })).toBeVisible(); const submodule = tree.getByRole("treeitem", { name: /service-snapshot.*a1234567/ });