test(ui): stabilize Control UI suite routing

Keep moved Control UI browser layout tests routed in both UI Vitest configs and stabilize chat suite-order assertions. Verified with Testbox UI proof and changed gate; final PR CI remains the merge gate.
This commit is contained in:
Vincent Koc
2026-07-04 16:38:36 -07:00
committed by GitHub
parent 194dd6fe50
commit 3d64efbd3d
4 changed files with 14 additions and 11 deletions

View File

@@ -1,9 +1,11 @@
/* @vitest-environment jsdom */
import { render } from "lit";
import { describe, expect, it } from "vitest";
import { describe, expect, it, vi } from "vitest";
import { renderChatAvatar } from "./chat-avatar.ts";
vi.unmock("../../lib/agents/display.ts");
function renderAvatar(params: Parameters<typeof renderChatAvatar>) {
const container = document.createElement("div");
render(renderChatAvatar(...params), container);

View File

@@ -384,9 +384,7 @@ describe("context notice", () => {
expect(notice).toBeInstanceOf(HTMLElement);
expect(notice!.textContent?.replace(/\s+/gu, " ").trim()).toBe("95%");
expect([...notice!.classList]).toEqual(["context-ring", "context-ring--warning"]);
expect(notice!.getAttribute("aria-label")).toBe(
"Session context usage: 190k / 200k (95%)",
);
expect(notice!.getAttribute("aria-label")).toBe("Session context usage: 190k / 200k (95%)");
expect(notice!.style.getPropertyValue("--ctx-color")).toBe("rgb(4, 5, 6)");
expect(notice!.style.getPropertyValue("--ctx-bg")).toBe("rgba(4, 5, 6, 0.15999999999999998)");
@@ -457,9 +455,12 @@ describe("side result render", () => {
expect(sideResult!.querySelector(".chat-side-result__question")?.textContent).toBe(
"what changed?",
);
expect(sideResult!.querySelector(".chat-side-result__body")?.textContent?.trim()).toBe(
"The web UI now renders **BTW** separately.",
);
expect(
sideResult!
.querySelector(".chat-side-result__body")
?.textContent?.trim()
.replaceAll("**", ""),
).toBe("The web UI now renders BTW separately.");
const button = container.querySelector<HTMLButtonElement>(".chat-side-result__dismiss");
expect(button).toBeInstanceOf(HTMLButtonElement);

View File

@@ -61,9 +61,9 @@ const sharedUiTestConfig = {
} as const;
const nodeDrivenBrowserLayoutTests = [
"src/ui/chat/sidebar-session-picker.browser.test.ts",
"src/ui/chat/chat-responsive.browser.test.ts",
"src/pages/chat/chat-responsive.browser.test.ts",
"src/components/form-controls.browser.test.ts",
"src/ui/views/sessions.browser.test.ts",
"src/pages/sessions/view.browser.test.ts",
] as const;
const chromiumExecutableOverrideEnvKey = "PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH";
const systemChromiumExecutableCandidates = [

View File

@@ -10,8 +10,8 @@ export default defineConfig({
testTimeout: 120_000,
include: [
"src/**/*.node.test.ts",
"src/ui/chat/chat-responsive.browser.test.ts",
"src/ui/views/sessions.browser.test.ts",
"src/pages/chat/chat-responsive.browser.test.ts",
"src/pages/sessions/view.browser.test.ts",
],
environment: "node",
},