Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(test): import getChatSurface statically instead of dynamically

Steven Enamakeld5e6f2226810
diff --git a/app/src/components/flows/WorkflowCopilotPanel.assistantUiRuntime.test.tsx b/app/src/components/flows/WorkflowCopilotPanel.assistantUiRuntime.test.tsx
index f26525c37d..56b1f40d3f 100644
--- a/app/src/components/flows/WorkflowCopilotPanel.assistantUiRuntime.test.tsx
+++ b/app/src/components/flows/WorkflowCopilotPanel.assistantUiRuntime.test.tsx
@@ -24,7 +24,7 @@ import { act, render, screen } from '@testing-library/react';
import { Provider } from 'react-redux';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-import { __resetChatSurfaces } from '../../providers/chatSurfaceHandlers';
+import { __resetChatSurfaces, getChatSurface } from '../../providers/chatSurfaceHandlers';
import chatRuntimeReducer, { type WorkflowProposal } from '../../store/chatRuntimeSlice';
import threadReducer from '../../store/threadSlice';
import type { ThreadMessage } from '../../types/thread';
@@ -220,7 +220,6 @@ describe('WorkflowCopilotPanel assistant-ui runtime', () => {
renderPanel();
// `sending` blocks a composer send, so `submit` no-ops; the cancel path is
// the one under test here.
- const { getChatSurface } = await import('../../providers/chatSurfaceHandlers');
await act(async () => {
await getChatSurface(BUILDER_THREAD)?.cancel?.();
});