This commit is contained in:
yyh
2026-03-12 15:45:24 +08:00
parent 2f85c77a54
commit e407d688d2

View File

@ -199,6 +199,42 @@ vi.mock('@/context/i18n', () => ({
useDocLink: () => (path: string) => `https://docs.dify.ai${path}`,
}))
vi.mock('../components/indexing-section', () => ({
default: ({
currentDataset,
indexMethod,
}: {
currentDataset?: DataSet
indexMethod?: IndexingType
}) => (
<div data-testid="indexing-section">
{!!currentDataset?.doc_form && (
<>
<div>form.chunkStructure.title</div>
<a href="https://docs.dify.ai/use-dify/knowledge/create-knowledge/chunking-and-cleaning-text">
form.chunkStructure.learnMore
</a>
</>
)}
{!!(currentDataset
&& currentDataset.doc_form !== ChunkingMode.parentChild
&& currentDataset.indexing_technique
&& indexMethod) && (
<div>form.indexMethod</div>
)}
{indexMethod === IndexingType.QUALIFIED && <div>form.embeddingModel</div>}
{currentDataset?.provider !== 'external' && indexMethod && (
<>
<div>form.retrievalSetting.title</div>
<a href="https://docs.dify.ai/use-dify/knowledge/create-knowledge/setting-indexing-methods">
form.retrievalSetting.learnMore
</a>
</>
)}
</div>
),
}))
describe('Form', () => {
beforeEach(() => {
vi.clearAllMocks()