mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 18:27:19 +08:00
fix(web): correct template of dataset evaluation
This commit is contained in:
parent
678327e994
commit
0ac0eccce4
@ -643,7 +643,7 @@ describe('Evaluation', () => {
|
||||
fireEvent.click(screen.getByRole('button', { name: 'evaluation.batch.downloadTemplate' }))
|
||||
|
||||
expect(downloadLink?.download).toBe('pipeline-evaluation-template.csv')
|
||||
expect(decodeURIComponent(downloadLink?.href ?? '')).toContain('query,expect_results\n')
|
||||
expect(decodeURIComponent(downloadLink?.href ?? '')).toContain('query,expected_outputs\n')
|
||||
expect(decodeURIComponent(downloadLink?.href ?? '')).not.toContain('expected_output')
|
||||
|
||||
createElementSpy.mockRestore()
|
||||
@ -667,14 +667,14 @@ describe('Evaluation', () => {
|
||||
fireEvent.click(screen.getByRole('button', { name: 'evaluation.pipeline.uploadAndRun' }))
|
||||
|
||||
expect(screen.getAllByText('query').length).toBeGreaterThan(0)
|
||||
expect(screen.getAllByText('expect_results').length).toBeGreaterThan(0)
|
||||
expect(screen.getAllByText('expected_outputs').length).toBeGreaterThan(0)
|
||||
|
||||
const fileInput = document.querySelector<HTMLInputElement>('input[type="file"][accept=".csv"]')
|
||||
expect(fileInput).toBeInTheDocument()
|
||||
|
||||
fireEvent.change(fileInput!, {
|
||||
target: {
|
||||
files: [new File(['query,expect_results'], 'pipeline-evaluation.csv', { type: 'text/csv' })],
|
||||
files: [new File(['query,expected_outputs'], 'pipeline-evaluation.csv', { type: 'text/csv' })],
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@ -11,9 +11,9 @@ import { useInputFieldsActions } from '../batch-test-panel/input-fields/use-inpu
|
||||
|
||||
const PIPELINE_INPUT_FIELDS: InputField[] = [
|
||||
{ name: 'query', type: 'string' },
|
||||
{ name: 'expect_results', type: 'string' },
|
||||
{ name: 'expected_outputs', type: 'string' },
|
||||
]
|
||||
const PIPELINE_TEMPLATE_CONTENT = 'query,expect_results\n'
|
||||
const PIPELINE_TEMPLATE_CONTENT = 'query,expected_outputs\n'
|
||||
|
||||
const PipelineBatchActions = ({
|
||||
resourceType,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user