diff --git a/web/app/components/base/chat/chat-with-history/inputs-form/__tests__/content.spec.tsx b/web/app/components/base/chat/chat-with-history/inputs-form/__tests__/content.spec.tsx index c863e3d339a..295f1fe1a4f 100644 --- a/web/app/components/base/chat/chat-with-history/inputs-form/__tests__/content.spec.tsx +++ b/web/app/components/base/chat/chat-with-history/inputs-form/__tests__/content.spec.tsx @@ -1,429 +1,264 @@ import type { ChatWithHistoryContextValue } from '../../context' -import type { FileEntity } from '@/app/components/base/file-uploader/types' -import { render, screen } from '@testing-library/react' +import { screen, waitFor } from '@testing-library/react' import userEvent from '@testing-library/user-event' -import * as React from 'react' -import { beforeEach, describe, expect, it, vi } from 'vite-plus/test' +import { useRef, useState } from 'react' +import { fileUpload } from '@/app/components/base/file-uploader/utils' import { InputVarType } from '@/app/components/workflow/types' +import { renderWithConsoleQuery } from '@/test/console/query-data' +import { createChatConfigFixture, createChatFileFixture } from '@/test/fixtures/chat' +import { createFileUploadConfigFixture } from '@/test/fixtures/file-upload-config' import { TransferMethod } from '@/types/app' -import { ChatWithHistoryContext } from '../../context' +import { ChatWithHistoryContext, useChatWithHistoryContext } from '../../context' import InputsFormContent from '../content' -vi.mock('@/app/components/workflow/nodes/_base/components/editor/code-editor', () => ({ - default: ({ - onChange, - value, - placeholder, - }: { - onChange: (v: string) => void - value: string - placeholder?: React.ReactNode - }) => ( -
-