fix(web): correct template of dataset evaluation

This commit is contained in:
JzoNg 2026-04-30 00:06:59 +08:00
parent 678327e994
commit 0ac0eccce4
2 changed files with 5 additions and 5 deletions

View File

@ -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' })],
},
})

View File

@ -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,