From 4bf348bec801f7135d3de6a3affdd0755dbe4f8a Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 9 Jul 2026 15:54:03 +0100 Subject: [PATCH] test(ui): isolate chat pane custom-element registration (#102869) * test(ui): isolate chat pane registration * test(ui): document shared registry invariant * test(ui): isolate chat page environment --- ui/src/pages/chat/chat-page.test.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ui/src/pages/chat/chat-page.test.ts b/ui/src/pages/chat/chat-page.test.ts index 56a5fb23857..67d4bfab311 100644 --- a/ui/src/pages/chat/chat-page.test.ts +++ b/ui/src/pages/chat/chat-page.test.ts @@ -1,13 +1,11 @@ /* @vitest-environment jsdom */ +/* @vitest-environment-options {"url":"http://chat-page.test/"} */ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -vi.mock("./chat-pane.ts", () => { - if (!customElements.get("openclaw-chat-pane")) { - customElements.define("openclaw-chat-pane", class extends HTMLElement {}); - } - return {}; -}); +// The dedicated jsdom context keeps this host-only mock from sharing the +// production tag registry with component tests. +vi.mock("./chat-pane.ts", () => ({})); import { loadSettings } from "../../app/settings.ts"; import type { ResizableDivider } from "../../components/resizable-divider.ts";