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
This commit is contained in:
Peter Steinberger 2026-07-09 15:54:03 +01:00 committed by GitHub
parent 54f45a950b
commit 4bf348bec8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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";