From 69a368fdf8bfbd2d583e58901ae1e5e7631b8b6c Mon Sep 17 00:00:00 2001 From: Xubin Ren <52506698+Re-bin@users.noreply.github.com> Date: Sat, 3 Oct 2026 23:16:28 +0800 Subject: [PATCH] test(webui): declare isolated preview support in navigation fixture --- webui/src/tests/temporary-chat-navigation.test.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webui/src/tests/temporary-chat-navigation.test.tsx b/webui/src/tests/temporary-chat-navigation.test.tsx index eac7b19d4..d2f34d8af 100644 --- a/webui/src/tests/temporary-chat-navigation.test.tsx +++ b/webui/src/tests/temporary-chat-navigation.test.tsx @@ -1,3 +1,4 @@ +// @vitest-environment-options {"settings":{"disableIframePageLoading":true}} import { act, cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; @@ -10,6 +11,7 @@ import { canonicalThreadPayload } from "./thread-test-payload"; let groupedTopics = false; let withFiles = false; +const credentialless = Object.getOwnPropertyDescriptor(HTMLIFrameElement.prototype, "credentialless"); const previewFile = (path: string) => ({ path: `/workspace/${path}`, display_path: path, project_path: "/workspace", language: "text", content: `Preview of ${path}`, size: 20, truncated: false, @@ -141,6 +143,8 @@ describe("temporary chat navigation", () => { afterEach(() => { cleanup(); + if (credentialless) Object.defineProperty(HTMLIFrameElement.prototype, "credentialless", credentialless); + else Reflect.deleteProperty(HTMLIFrameElement.prototype, "credentialless"); if (vi.isFakeTimers()) vi.clearAllTimers(); vi.useRealTimers(); vi.restoreAllMocks(); @@ -312,6 +316,8 @@ describe("temporary chat navigation", () => { }); it("restores website targets per session, switches to files, and closes below menus", async () => { + // Exercise the working embed path; unsupported browsers do not offer it. + Object.defineProperty(HTMLIFrameElement.prototype, "credentialless", { configurable: true, value: false }); withFiles = true; render(); await screen.findByRole("button", { name: "Temporary chat" });