diff --git a/ui/src/pages/chat/chat-avatar.test.ts b/ui/src/pages/chat/chat-avatar.test.ts index a19dd1d0c9c0..3268b200ca14 100644 --- a/ui/src/pages/chat/chat-avatar.test.ts +++ b/ui/src/pages/chat/chat-avatar.test.ts @@ -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) { const container = document.createElement("div"); render(renderChatAvatar(...params), container); diff --git a/ui/src/pages/chat/chat-composer.test.ts b/ui/src/pages/chat/chat-composer.test.ts index 3247e3818822..d6f35ad4112d 100644 --- a/ui/src/pages/chat/chat-composer.test.ts +++ b/ui/src/pages/chat/chat-composer.test.ts @@ -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(".chat-side-result__dismiss"); expect(button).toBeInstanceOf(HTMLButtonElement); diff --git a/ui/vitest.config.ts b/ui/vitest.config.ts index ee0225db63a3..1b635e799144 100644 --- a/ui/vitest.config.ts +++ b/ui/vitest.config.ts @@ -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 = [ diff --git a/ui/vitest.node.config.ts b/ui/vitest.node.config.ts index 72713f3b1d47..c2b50126a255 100644 --- a/ui/vitest.node.config.ts +++ b/ui/vitest.node.config.ts @@ -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", },