Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(desktop-ui): r10-l2 narrow the harness toast function type

Josuéa646be8beaf8
diff --git a/desktop-app/ui/src/hooks/domain/__tests__/__fixtures__/controllerHarness.tsx b/desktop-app/ui/src/hooks/domain/__tests__/__fixtures__/controllerHarness.tsx
index 26b1587cf..46fa0f7ae 100644
--- a/desktop-app/ui/src/hooks/domain/__tests__/__fixtures__/controllerHarness.tsx
+++ b/desktop-app/ui/src/hooks/domain/__tests__/__fixtures__/controllerHarness.tsx
@@ -3,6 +3,7 @@ import { vi } from 'vitest'
import { AgentTaskTrackerProvider } from '@contexts/AgentTaskTrackerContext'
import { act, renderHook } from '@testing-library/react'
import type { HostAuthorityHoldKind } from '../../../../lib/hostAuthorityStore'
+import type { Tone } from '../../../../uiTypes'
import { useAgentChatController } from '../../useAgentChatController'
import { type HarnessHostAuthority, useHarnessHostAuthority } from './hostAuthorityHarness'
@@ -26,7 +27,7 @@ export interface RenderControllerResult {
isBlocked: (agentRef: string) => boolean
}
spies: {
- pushToast: ReturnType<typeof vi.fn>
+ pushToast: ReturnType<typeof vi.fn<(message: string, tone: Tone) => void>>
pushNotification: ReturnType<typeof vi.fn>
showDesktopNotification: ReturnType<typeof vi.fn>
openAgentConversationFromNotification: ReturnType<typeof vi.fn>
@@ -56,7 +57,7 @@ export function renderController(
options: RenderControllerOptions = {}
): RenderControllerResult {
const spies = {
- pushToast: vi.fn(),
+ pushToast: vi.fn<(message: string, tone: Tone) => void>(),
pushNotification: vi.fn(),
showDesktopNotification: vi.fn(async () => 'granted' as const),
openAgentConversationFromNotification: vi.fn(async () => undefined),