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
- }) => (
-
- ),
+vi.mock('@/next/navigation', async (importOriginal) => ({
+ ...(await importOriginal()),
+ useParams: () => ({}),
+ usePathname: () => '/chat',
}))
-const uploadedFile: FileEntity = {
- id: 'uploaded-file-1',
- uploadedId: 'server-file-1',
+vi.mock('@/app/components/base/file-uploader/utils', async (importOriginal) => ({
+ ...(await importOriginal()),
+ fileUpload: vi.fn(),
+}))
+
+const uploadedFile = createChatFileFixture({
name: 'report.pdf',
- size: 100,
type: 'application/pdf',
- supportFileType: 'document',
- progress: 100,
- transferMethod: TransferMethod.local_file,
-}
-
-// MOCK: file-uploader (stable, deterministic for unit tests)
-vi.mock('@/app/components/base/file-uploader', () => ({
- FileUploaderInAttachmentWrapper: ({
- onChange,
- value,
- }: {
- onChange: (files: FileEntity[]) => void
- value?: FileEntity[]
- }) => (
-