mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +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}`,
|
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', () => {
|
describe('Form', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vi.clearAllMocks()
|
vi.clearAllMocks()
|
||||||
|
|||||||
Reference in New Issue
Block a user