From 0ac0eccce43415dc54697ae685c0fbabd7c3f954 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 30 Apr 2026 00:06:59 +0800 Subject: [PATCH] fix(web): correct template of dataset evaluation --- web/app/components/evaluation/__tests__/index.spec.tsx | 6 +++--- .../components/pipeline/pipeline-batch-actions.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/app/components/evaluation/__tests__/index.spec.tsx b/web/app/components/evaluation/__tests__/index.spec.tsx index 95e295903d..140ef72edd 100644 --- a/web/app/components/evaluation/__tests__/index.spec.tsx +++ b/web/app/components/evaluation/__tests__/index.spec.tsx @@ -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('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' })], }, }) diff --git a/web/app/components/evaluation/components/pipeline/pipeline-batch-actions.tsx b/web/app/components/evaluation/components/pipeline/pipeline-batch-actions.tsx index 474227c660..63a529f63c 100644 --- a/web/app/components/evaluation/components/pipeline/pipeline-batch-actions.tsx +++ b/web/app/components/evaluation/components/pipeline/pipeline-batch-actions.tsx @@ -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,