mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 08:03:19 +00:00
The Breakpoints dialog had a fixed list width beside the details, so in narrow windows locations were clipped and the details' controls ran off the dialog. The list and details are now a resizable split that stacks vertically below 560px (each layout remembered), the dialog itself can be resized, and locations show the file name and line with the full path in the tooltip.
51 lines
2.9 KiB
TypeScript
51 lines
2.9 KiB
TypeScript
import { expect, test } from "./fixtures";
|
|
|
|
test("keeps breakpoint details editable when the dialog gets narrow", async ({ workbench: page }) => {
|
|
await page.setViewportSize({ width: 500, height: 480 });
|
|
await page.evaluate(async () => {
|
|
const actionsModule = "/src/platform/actions.ts";
|
|
const storeModule = "/src/features/debugger/breakpoints/store.ts";
|
|
const { executeAction } = await import(/* @vite-ignore */ actionsModule);
|
|
const { addBreakpoint } = await import(/* @vite-ignore */ storeModule);
|
|
addBreakpoint("/dev/acme-api/CheckInternationalSettlementBeforeDispatch.java", 7, {
|
|
condition: "amount > 100",
|
|
});
|
|
addBreakpoint("/dev/acme-api/Receipt.java", 4);
|
|
await executeAction("debug.viewBreakpoints");
|
|
});
|
|
|
|
const dialog = page.getByRole("dialog", { name: "Breakpoints" });
|
|
const list = dialog.getByRole("listbox", { name: "All breakpoints" });
|
|
const condition = dialog.locator('input[aria-label="Condition"]');
|
|
await expect(condition).toHaveValue("amount > 100");
|
|
await expect.poll(async () => (await condition.boundingBox())?.width ?? 0).toBeGreaterThanOrEqual(240);
|
|
await expect(dialog.getByRole("button", { name: "Done", exact: true })).toBeInViewport({ ratio: 1 });
|
|
await condition.fill("amount > 250");
|
|
await dialog.getByRole("checkbox", { name: "Evaluate and log", exact: true }).check();
|
|
await dialog.getByRole("textbox", { name: "Evaluate and log", exact: true }).fill("total: {amount}");
|
|
const first = list.getByRole("option", { name: /CheckInternationalSettlementBeforeDispatch\.java:8/ });
|
|
await expect(first.getByText(":8", { exact: true })).toBeInViewport({ ratio: 1 });
|
|
await list.getByRole("option", { name: /Receipt\.java:5/ }).click();
|
|
await expect(condition).toHaveValue("");
|
|
await first.click();
|
|
await expect(condition).toHaveValue("amount > 250");
|
|
await expect(dialog.getByRole("textbox", { name: "Evaluate and log", exact: true })).toHaveValue("total: {amount}");
|
|
|
|
await page.setViewportSize({ width: 1080, height: 760 });
|
|
const divider = dialog.locator('[data-separator][aria-orientation="vertical"]');
|
|
await expect(divider).toBeInViewport();
|
|
const oldWidth = (await list.boundingBox())!.width;
|
|
const handle = (await divider.boundingBox())!;
|
|
await page.mouse.move(handle.x + handle.width / 2, handle.y + handle.height / 2);
|
|
await page.mouse.down();
|
|
await page.mouse.move(handle.x + 60, handle.y + handle.height / 2, { steps: 4 });
|
|
await page.mouse.up();
|
|
await expect.poll(async () => (await list.boundingBox())?.width ?? 0).toBeGreaterThan(oldWidth + 20);
|
|
await expect(condition).toHaveValue("amount > 250");
|
|
const request = dialog.getByRole("textbox", { name: "Part of a request URL" });
|
|
await request.scrollIntoViewIfNeeded();
|
|
await expect(request).toBeInViewport({ ratio: 1 });
|
|
await dialog.getByRole("button", { name: "Done", exact: true }).click();
|
|
await expect(dialog).toBeHidden();
|
|
});
|