import { expect, test } from "@playwright/test"; test("Java Class Fields styles apply per field kind and fall back to the Language Defaults (#7643)", async ({ page, }) => { await page.goto("/e2e/javaFieldStyle.html"); const instance = page.locator(".cm-sem-java-instance-field"); const instanceFinal = page.locator(".cm-sem-java-instance-final-field"); const staticField = page.locator(".cm-sem-java-static-field"); const constant = page.locator(".cm-sem-java-constant"); await expect(constant).toHaveText("MAX"); // Only the constant is bold; both static kinds keep the Language Defaults static field colour and italic. await expect(constant).toHaveCSS("font-weight", "700"); await expect(constant).toHaveCSS("font-style", "italic"); await expect(constant).toHaveCSS("color", "rgb(152, 118, 170)"); await expect(staticField).toHaveCSS("font-weight", "400"); await expect(staticField).toHaveCSS("font-style", "italic"); await expect(staticField).toHaveCSS("color", "rgb(152, 118, 170)"); // Instance fields stay upright; the final one has its own colour. await expect(instance).toHaveCSS("font-style", "normal"); await expect(instance).toHaveCSS("font-weight", "400"); await expect(instanceFinal).toHaveCSS("color", "rgb(204, 120, 50)"); await expect(instanceFinal).toHaveCSS("font-style", "normal"); });