refactor(tests): restructure workflow run test data for improved organization

- Updated test cases in `use-workflow-run.spec.ts` to encapsulate workflow status and related data within a `data` object for better clarity and maintainability.
- Ensured consistency in the structure of test data across different scenarios.
This commit is contained in:
CodingOnStar
2026-05-14 12:02:02 +08:00
parent c139c776ba
commit d288e7a42e

View File

@ -442,10 +442,12 @@ describe('useWorkflowRun', () => {
workflow_id: 'flow-1',
reason: 'failed',
node_type: 'llm',
workflow_status: WorkflowRunningStatus.Running,
workflow_tracing_count: 1,
workflow_data: workflowData,
workflow_data_json: JSON.stringify(workflowData),
data: {
workflow_status: WorkflowRunningStatus.Running,
workflow_tracing_count: 1,
workflow_data: workflowData,
workflow_data_json: JSON.stringify(workflowData),
},
})
mocks.mockTrackEvent.mockClear()
@ -455,10 +457,12 @@ describe('useWorkflowRun', () => {
workflow_id: 'flow-1',
reason: 'Server Error',
node_type: undefined,
workflow_status: WorkflowRunningStatus.Running,
workflow_tracing_count: 1,
workflow_data: workflowData,
workflow_data_json: JSON.stringify(workflowData),
data: {
workflow_status: WorkflowRunningStatus.Running,
workflow_tracing_count: 1,
workflow_data: workflowData,
workflow_data_json: JSON.stringify(workflowData),
},
})
})