From deecdbbf4fadba37e3951d26dd5ddc2e71b992ed Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Fri, 20 Nov 2026 17:29:09 +0800 Subject: [PATCH] test(e2e): fix the Python highlighting and Recent Locations specs (#4752) pythonHighlight: the fixture's Darcula-based scheme doesn't name NOT_USED_ELEMENT_ATTRIBUTES, which since #4737 comes from Darcula (#72737A). recentNavigationLayout: the snippet height check allows a fractional pixel (89.94px vs 90px). --- e2e/pythonHighlight.spec.ts | 3 ++- e2e/recentNavigationLayout.spec.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/e2e/pythonHighlight.spec.ts b/e2e/pythonHighlight.spec.ts index aa70a0f49..cd4b19bca 100644 --- a/e2e/pythonHighlight.spec.ts +++ b/e2e/pythonHighlight.spec.ts @@ -53,7 +53,8 @@ test("Python syntax supplements retain PyCharm colours without a language server await expect(page.locator(".cm-sem-python-predefined-definition")).toHaveCSS("color", "rgb(187, 153, 34)"); await expect(page.locator(".cm-sem-python-predefined-usage")).toHaveCSS("color", "rgb(204, 170, 51)"); await expect(page.locator(".cm-sem-keyword").filter({ hasText: /^type$/ })).toHaveCSS("color", "rgb(17, 34, 51)"); - await expect(page.locator(".cm-sem-unused")).toHaveCSS("color", "rgb(111, 115, 122)"); + // The scheme is Darcula-based and doesn't name NOT_USED_ELEMENT_ATTRIBUTES: Darcula's #72737A applies. + await expect(page.locator(".cm-sem-unused")).toHaveCSS("color", "rgb(114, 115, 122)"); expect(errors).toEqual([]); await page.screenshot({ path: info.outputPath("python-highlighting.png") }); }); diff --git a/e2e/recentNavigationLayout.spec.ts b/e2e/recentNavigationLayout.spec.ts index ecc9ff931..57889c4d2 100644 --- a/e2e/recentNavigationLayout.spec.ts +++ b/e2e/recentNavigationLayout.spec.ts @@ -84,7 +84,8 @@ test("Recent Locations keeps all snippet lines visible when the editor font grow await expect(code).toHaveCSS("font-size", "19px"); await expect(code).toHaveCSS("line-height", "30px"); await expect(code).toHaveCSS("font-family", /"Fira Code".*"Maple Mono NF CN"/); - expect((await code.boundingBox())!.height).toBe(90); + // Three 30px lines; layout may land on a fractional pixel. + expect((await code.boundingBox())!.height).toBeCloseTo(90, 0); await page.setViewportSize({ width: 400, height: 500 }); const filter = dialog.getByRole("textbox", { name: "Filter recent locations" });