LibreChat/client/test/chatHost.tsx
Marco Beretta 7e56534c5f
🧰 refactor: Move useChatHelpers and ChatProvider into the Chat Package (#17446)
useChatHelpers now builds the pane contract from a ChatHost the app supplies:
its pane store, message query cache, turn builder, thread selection, abort
transport and settings. The stop path lives in its own module, its spec runs
in the package against a host with no app behind it, and the app mounts its
host in Root beside the steer host.
2026-10-26 22:47:11 +01:00

9 lines
502 B
TypeScript

import React from 'react';
import { ChatHostProvider } from '@librechat/chat/react';
import { appChatHost } from '~/Providers/ChatHostContext';
/** Mounts the app's chat host the way `routes/Root.tsx` does, for specs that render the chat
* hooks outside the app shell. Import it after the spec's module mocks so the host uses them. */
export function ChatHostTestProvider({ children }: { children?: React.ReactNode }) {
return <ChatHostProvider host={appChatHost}>{children}</ChatHostProvider>;
}