From 6eb1f0713dcb3cabe58fccbdec872812d8d59c87 Mon Sep 17 00:00:00 2001 From: faysou Date: Wed, 2 Dec 2026 17:37:04 +0000 Subject: [PATCH] test(vcs): verify the single-row Worktrees layout (#7588) The Worktrees panel shows the folder, branch and path on one row, but the layout spec still expected the folder above the branch and failed. It now checks the three columns in order on one line, keeping the toolbar, submodule and keyboard selection checks. Co-authored-by: faysou <893862+faysou@users.noreply.github.com> --- e2e/gitWorktreesLayout.spec.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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/ });