Файли
openidea/e2e/projectTreeLabels.spec.ts
T
l0ng-ai 35529ddd64 test(project-view): use a project name that fits a narrow tree on Linux too (#7897)
On the Linux runner's font the old project name alone was wider than the narrow tree, so the spec failed on every main run; a shorter name still needs the path to give way and fits on both platforms.
2026-12-04 08:33:19 +08:00

21 рядки
1.1 KiB
TypeScript

import { expect, test } from "./fixtures";
test("gives the project name room before its path in a narrow tree", async ({ workbench: page }) => {
await page.evaluate(async () => {
const storeModule = "/src/features/project-tree/store.ts";
const { useProjectTree } = await import(/* @vite-ignore */ storeModule);
useProjectTree.setState({ name: "checkout-orders" });
});
const pane = page.getByRole("region", { name: "Project", exact: true });
await pane.getByRole("button", { name: "Options", exact: true }).click();
await page.getByRole("menuitem", { name: "Appearance", exact: true }).hover();
await page.getByRole("menuitemcheckbox", { name: "Horizontal Scrolling" }).click();
const tree = pane.getByRole("tree", { name: "Project" });
const name = tree.getByText("checkout-orders", { exact: true });
await expect(name).toBeVisible();
await expect.poll(() => name.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
await expect.poll(() => tree.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
});