diff --git a/clients/web/src/App.test.tsx b/clients/web/src/App.test.tsx index 19d43ae48..c66cb03bf 100644 --- a/clients/web/src/App.test.tsx +++ b/clients/web/src/App.test.tsx @@ -7,6 +7,21 @@ import { } from "./test/renderWithMantine"; import userEvent from "@testing-library/user-event"; +// Spy on the toast layer so the progress-notification tests can assert the +// show/update calls without mounting Mantine's portal. +// `vi.hoisted` lets the mock factory (hoisted above imports) reach the spies. +const { notificationsMock } = vi.hoisted(() => ({ + notificationsMock: { + show: vi.fn(), + update: vi.fn(), + hide: vi.fn(), + clean: vi.fn(), + }, +})); +vi.mock("@mantine/notifications", () => ({ + notifications: notificationsMock, +})); + // App is a wiring component: it owns session-scoped UI state (the per-call // result panels and the optimistic log level) and resets it when the active // InspectorClient emits `disconnect`. These tests exercise that reset in @@ -177,10 +192,37 @@ vi.mock("@inspector/core/react/useSettingsDraft.js", () => ({ vi.mock("./components/views/InspectorView/InspectorView", () => ({ InspectorView: (props: { toolCallState?: { status?: string }; + toolsUi?: { + selectedToolName?: string; + formValues: Record; + search: string; + }; + promptsUi?: { + selectedPromptName?: string; + argumentValues: Record; + submittedFor?: string; + search: string; + }; + logsUi?: { filterText: string; visibleLevels: Record }; getPromptState?: { status?: string }; readResourceState?: { status?: string }; currentLogLevel?: string; onToggleConnection: (id: string) => void; + onToolsUiChange: (next: { + selectedToolName?: string; + formValues: Record; + search: string; + }) => void; + onPromptsUiChange: (next: { + selectedPromptName?: string; + argumentValues: Record; + submittedFor?: string; + search: string; + }) => void; + onLogsUiChange: (next: { + filterText: string; + visibleLevels: Record; + }) => void; onCallTool: (name: string, args: Record) => void; onGetPrompt: (name: string, args: Record) => void; onReadResource: (uri: string) => void; @@ -190,6 +232,14 @@ vi.mock("./components/views/InspectorView/InspectorView", () => ({ {props.toolCallState?.status ?? "none"} + + {props.toolsUi?.selectedToolName ?? "none"} + + {props.toolsUi?.search || "none"} + + {props.promptsUi?.selectedPromptName ?? "none"} + + {props.logsUi?.filterText || "none"} {props.getPromptState?.status ?? "none"} @@ -198,6 +248,64 @@ vi.mock("./components/views/InspectorView/InspectorView", () => ({ {props.currentLogLevel} + + + + +