test(ui): speed up chat icon mocks · openclaw/openclaw@847c00d
steipete
·
2026-04-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -26,12 +26,7 @@ vi.mock("../markdown.ts", () => ({
|
26 | 26 | })); |
27 | 27 | |
28 | 28 | vi.mock("../icons.ts", () => ({ |
29 | | -icons: new Proxy( |
30 | | -{}, |
31 | | -{ |
32 | | -get: () => "", |
33 | | -}, |
34 | | -), |
| 29 | +icons: {}, |
35 | 30 | })); |
36 | 31 | |
37 | 32 | vi.mock("../views/agents-utils.ts", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,6 +4,10 @@ import { render } from "lit";
|
4 | 4 | import { describe, expect, it, vi } from "vitest"; |
5 | 5 | import { renderChatRunControls, type ChatRunControlsProps } from "./run-controls.ts"; |
6 | 6 | |
| 7 | +vi.mock("../icons.ts", () => ({ |
| 8 | +icons: {}, |
| 9 | +})); |
| 10 | + |
7 | 11 | function createProps(overrides: Partial<ChatRunControlsProps> = {}): ChatRunControlsProps { |
8 | 12 | return { |
9 | 13 | canAbort: false, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,6 +4,10 @@ import { html, render } from "lit";
|
4 | 4 | import { describe, expect, it, vi } from "vitest"; |
5 | 5 | import { renderCompactionIndicator, renderFallbackIndicator } from "./status-indicators.ts"; |
6 | 6 | |
| 7 | +vi.mock("../icons.ts", () => ({ |
| 8 | +icons: {}, |
| 9 | +})); |
| 10 | + |
7 | 11 | describe("chat status indicators", () => { |
8 | 12 | it("renders compaction and fallback indicators while they are fresh", () => { |
9 | 13 | const container = document.createElement("div"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,12 +5,7 @@ import { describe, expect, it, vi } from "vitest";
|
5 | 5 | import { buildToolCardSidebarContent, extractToolCards, renderToolCard } from "./tool-cards.ts"; |
6 | 6 | |
7 | 7 | vi.mock("../icons.ts", () => ({ |
8 | | -icons: new Proxy( |
9 | | -{}, |
10 | | -{ |
11 | | -get: () => "", |
12 | | -}, |
13 | | -), |
| 8 | +icons: {}, |
14 | 9 | })); |
15 | 10 | |
16 | 11 | vi.mock("../tool-display.ts", () => ({ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,12 +8,7 @@ import { renderWelcomeState } from "../chat/chat-welcome.ts";
|
8 | 8 | import type { ChatQueueItem } from "../ui-types.ts"; |
9 | 9 | |
10 | 10 | vi.mock("../icons.ts", () => ({ |
11 | | -icons: new Proxy( |
12 | | -{}, |
13 | | -{ |
14 | | -get: () => "", |
15 | | -}, |
16 | | -), |
| 11 | +icons: {}, |
17 | 12 | })); |
18 | 13 | |
19 | 14 | vi.mock("./agents-utils.ts", () => ({ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。