mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:00:43 +00:00
test(ui): speed up chat icon mocks
This commit is contained in:
@@ -26,12 +26,7 @@ vi.mock("../markdown.ts", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("../icons.ts", () => ({
|
||||
icons: new Proxy(
|
||||
{},
|
||||
{
|
||||
get: () => "",
|
||||
},
|
||||
),
|
||||
icons: {},
|
||||
}));
|
||||
|
||||
vi.mock("../views/agents-utils.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> = {}): ChatRunControlsProps {
|
||||
return {
|
||||
canAbort: false,
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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", () => ({
|
||||
|
||||
@@ -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", () => ({
|
||||
|
||||
Reference in New Issue
Block a user