test: add comprehensive Jest tests for CustomPage and WorkflowOnboardingModal components (#29714)

This commit is contained in:
yyh
2025-12-16 14:18:09 +08:00
committed by GitHub
parent 7695f9151c
commit 4553e4c12f
7 changed files with 2121 additions and 15 deletions

View File

@@ -5,13 +5,6 @@ import type { ParentMode, SimpleDocumentDetail } from '@/models/datasets'
import { ChunkingMode, DataSourceType } from '@/models/datasets'
import DocumentPicker from './index'
// Mock react-i18next
jest.mock('react-i18next', () => ({
useTranslation: () => ({
t: (key: string) => key,
}),
}))
// Mock portal-to-follow-elem - always render content for testing
jest.mock('@/app/components/base/portal-to-follow-elem', () => ({
PortalToFollowElem: ({ children, open }: {

View File

@@ -3,7 +3,7 @@ import { fireEvent, render, screen } from '@testing-library/react'
import type { DocumentItem } from '@/models/datasets'
import PreviewDocumentPicker from './preview-document-picker'
// Mock react-i18next
// Override shared i18n mock for custom translations
jest.mock('react-i18next', () => ({
useTranslation: () => ({
t: (key: string, params?: Record<string, unknown>) => {