From 847c00d409283fe88d3f5219d9aebf4d5075b18b Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 25 Apr 2026 18:27:10 +0100 Subject: [PATCH] test(ui): speed up chat icon mocks --- ui/src/ui/chat/grouped-render.test.ts | 7 +------ ui/src/ui/chat/run-controls.test.ts | 4 ++++ ui/src/ui/chat/status-indicators.test.ts | 4 ++++ ui/src/ui/chat/tool-cards.test.ts | 7 +------ ui/src/ui/views/chat.test.ts | 7 +------ 5 files changed, 11 insertions(+), 18 deletions(-) diff --git a/ui/src/ui/chat/grouped-render.test.ts b/ui/src/ui/chat/grouped-render.test.ts index 994cd139948..01e22a559f5 100644 --- a/ui/src/ui/chat/grouped-render.test.ts +++ b/ui/src/ui/chat/grouped-render.test.ts @@ -26,12 +26,7 @@ vi.mock("../markdown.ts", () => ({ })); vi.mock("../icons.ts", () => ({ - icons: new Proxy( - {}, - { - get: () => "", - }, - ), + icons: {}, })); vi.mock("../views/agents-utils.ts", () => { diff --git a/ui/src/ui/chat/run-controls.test.ts b/ui/src/ui/chat/run-controls.test.ts index 260891167b0..19941b8050c 100644 --- a/ui/src/ui/chat/run-controls.test.ts +++ b/ui/src/ui/chat/run-controls.test.ts @@ -4,6 +4,10 @@ import { render } from "lit"; import { describe, expect, it, vi } from "vitest"; import { renderChatRunControls, type ChatRunControlsProps } from "./run-controls.ts"; +vi.mock("../icons.ts", () => ({ + icons: {}, +})); + function createProps(overrides: Partial = {}): ChatRunControlsProps { return { canAbort: false, diff --git a/ui/src/ui/chat/status-indicators.test.ts b/ui/src/ui/chat/status-indicators.test.ts index 8b3b5552c1e..15c1e00df9d 100644 --- a/ui/src/ui/chat/status-indicators.test.ts +++ b/ui/src/ui/chat/status-indicators.test.ts @@ -4,6 +4,10 @@ import { html, render } from "lit"; import { describe, expect, it, vi } from "vitest"; import { renderCompactionIndicator, renderFallbackIndicator } from "./status-indicators.ts"; +vi.mock("../icons.ts", () => ({ + icons: {}, +})); + describe("chat status indicators", () => { it("renders compaction and fallback indicators while they are fresh", () => { const container = document.createElement("div"); diff --git a/ui/src/ui/chat/tool-cards.test.ts b/ui/src/ui/chat/tool-cards.test.ts index bf5a5c23b3e..ab83169c3c2 100644 --- a/ui/src/ui/chat/tool-cards.test.ts +++ b/ui/src/ui/chat/tool-cards.test.ts @@ -5,12 +5,7 @@ import { describe, expect, it, vi } from "vitest"; import { buildToolCardSidebarContent, extractToolCards, renderToolCard } from "./tool-cards.ts"; vi.mock("../icons.ts", () => ({ - icons: new Proxy( - {}, - { - get: () => "", - }, - ), + icons: {}, })); vi.mock("../tool-display.ts", () => ({ diff --git a/ui/src/ui/views/chat.test.ts b/ui/src/ui/views/chat.test.ts index 8345436d909..e314d630022 100644 --- a/ui/src/ui/views/chat.test.ts +++ b/ui/src/ui/views/chat.test.ts @@ -8,12 +8,7 @@ import { renderWelcomeState } from "../chat/chat-welcome.ts"; import type { ChatQueueItem } from "../ui-types.ts"; vi.mock("../icons.ts", () => ({ - icons: new Proxy( - {}, - { - get: () => "", - }, - ), + icons: {}, })); vi.mock("./agents-utils.ts", () => ({