test(e2e): fix the main branch's failing layout and caret key specs (#7945)

caretKeysEverywhere bound "Control+H", which is not a key stroke, so Move Caret Left was never bound; it passed on macOS only because Ctrl+H deletes backward there. compactMode expects the 30px status bar, toolbarCustomization measures the first visible item after the Center group, the commit check spec accepts a sub-pixel clip, and codeLensLayout waits for the editor to measure.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-12-04 13:40:15 +08:00
1 джерело ed57059cad
коміт 166ef2dffa
5 files changed
+16 -6

No files matched your search

+3 -1
Переглянути файл
@@ -10,7 +10,7 @@ test("rebound caret keys move the project tree, Go to File's list and text field
overrides: {
"editor.up": ["Meta+K"],
"editor.down": ["Meta+J"],
"editor.left": ["Control+H"],
"editor.left": ["Ctrl+H"],
"editor.lineStart": ["Meta+H"],
},
});
@@ -48,6 +48,8 @@ test("rebound caret keys move the project tree, Go to File's list and text field
await page.keyboard.press("Meta+k");
await expect(lead).toHaveText(first!);
await page.keyboard.press("Control+h");
// Moved, not deleted: macOS also maps ⌃H to Delete Backward in text fields.
await expect(field).toHaveValue("Order");
expect(await field.evaluate((el: HTMLInputElement) => [el.selectionStart, el.selectionEnd])).toEqual([4, 4]);
await page.keyboard.press("Meta+h");
expect(await field.evaluate((el: HTMLInputElement) => [el.selectionStart, el.selectionEnd])).toEqual([0, 0]);
+6 -2
Переглянути файл
@@ -42,8 +42,12 @@ test("a Code Vision row fits CJK hints at a large editor font", async ({ workben
// The editor measured the taller row: the lines below it still sit beside their numbers.
const line = editor.locator(".cm-line", { hasText: "class OrderController" });
const number = editor.locator(".cm-lineNumbers .cm-gutterElement", { hasText: /^8$/ });
const [lineTop, numberTop] = [(await line.boundingBox())!.y, (await number.boundingBox())!.y];
expect(Math.abs(lineTop - numberTop)).toBeLessThanOrEqual(1);
await expect
.poll(async () => {
const [lineBox, numberBox] = await Promise.all([line.boundingBox(), number.boundingBox()]);
return Math.abs(lineBox!.y - numberBox!.y);
})
.toBeLessThanOrEqual(1);
});
test("a Code Vision row keeps its height at the default editor font", async ({ workbench: page }) => {
+2 -1
Переглянути файл
@@ -843,7 +843,8 @@ test("commit check text scrolls independently of its status icon and retry actio
expect((await icon.boundingBox())!.y).toBeCloseTo(statusTop, 0);
expect((await retry.boundingBox())!.y).toBeCloseTo(retryTop, 0);
const details = feedback.getByRole("button", { name: "Review final check", exact: true });
await expect(details).toBeInViewport({ ratio: 1 });
// Scrolled to the end of a list with a fractional height: at most a sub-pixel sliver stays clipped.
await expect(details).toBeInViewport({ ratio: 0.99 });
await expect(icon).toBeInViewport({ ratio: 1 });
await expect(retry).toBeInViewport({ ratio: 1 });
await expect(commitAnyway).toBeInViewport({ ratio: 1 });
+1 -1
Переглянути файл
@@ -2,7 +2,7 @@ import { expect, test } from "./fixtures";
/** Heights IDEA's Islands theme uses in compact mode (`*.compact` keys), against the defaults. */
const SIZES = {
normal: { titleBar: 40, treeRow: 24, stripeIcon: 20, statusBar: 34, runButton: 30 },
normal: { titleBar: 40, treeRow: 24, stripeIcon: 20, statusBar: 30, runButton: 30 },
compact: { titleBar: 32, treeRow: 22, stripeIcon: 16, statusBar: 24, runButton: 26 },
};
+4 -1
Переглянути файл
@@ -108,7 +108,10 @@ test("the Center group is centred in the main toolbar", async ({ workbench: page
}
// The old 900px width: no room to centre, so the group is pushed left of the right group, never over it.
await page.setViewportSize({ width: 900, height: 700 });
const rightGroup = bar.locator("[data-toolbar-center] ~ :not([data-toolbar-spacer])").first();
const rightGroup = bar
.locator("[data-toolbar-center] ~ :not([data-toolbar-spacer])")
.filter({ visible: true })
.first();
await expect(async () => {
const [barBox, groupBox, rightBox] = await Promise.all([
bar.boundingBox(),