diff --git a/web/app/components/base/chat/embedded-chatbot/chat-wrapper.spec.tsx b/web/app/components/base/chat/embedded-chatbot/chat-wrapper.spec.tsx new file mode 100644 index 0000000000..d0b23627f0 --- /dev/null +++ b/web/app/components/base/chat/embedded-chatbot/chat-wrapper.spec.tsx @@ -0,0 +1,400 @@ +import type { ChatConfig, ChatItem, ChatItemInTree } from '../types' +import type { EmbeddedChatbotContextValue } from './context' +import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' +import { vi } from 'vitest' +import { InputVarType } from '@/app/components/workflow/types' +import { + AppSourceType, + fetchSuggestedQuestions, + submitHumanInputForm, +} from '@/service/share' +import { submitHumanInputForm as submitHumanInputFormService } from '@/service/workflow' +import { useChat } from '../chat/hooks' +import ChatWrapper from './chat-wrapper' +import { useEmbeddedChatbotContext } from './context' + +vi.mock('./context', () => ({ + useEmbeddedChatbotContext: vi.fn(), +})) + +vi.mock('../chat/hooks', () => ({ + useChat: vi.fn(), +})) + +vi.mock('./inputs-form', () => ({ + __esModule: true, + default: () =>