mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-06 19:32:58 +08:00
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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user