mirror of
https://github.com/langgenius/dify.git
synced 2026-03-21 06:18:27 +08:00
fix test
This commit is contained in:
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user