fix(test): add knowledgeName and knowledgeIcon to useWorkflowStore mock

Update test mock to include knowledgeName and knowledgeIcon in
getState() return value to match the component's usage of getState()
for lazy initialization.
This commit is contained in:
yyh
2026-01-18 02:15:46 +08:00
parent 1e654ee1b8
commit 4c256bffe5
2 changed files with 9 additions and 7 deletions

View File

@ -92,6 +92,13 @@ vi.mock('@/app/components/workflow/store', () => {
useWorkflowStore: () => ({
getState: () => ({
pipelineId: 'test-pipeline-id',
knowledgeName: 'Test Knowledge',
knowledgeIcon: {
icon_type: 'emoji' as const,
icon: '📚',
icon_background: '#FFFFFF',
icon_url: '',
},
setShowInputFieldPanel: mockSetShowInputFieldPanel,
setShowEnvPanel: mockSetShowEnvPanel,
setShowImportDSLModal: mockSetShowImportDSLModal,

View File

@ -518,7 +518,7 @@
},
"app/components/app/configuration/prompt-value-panel/index.spec.tsx": {
"ts/no-explicit-any": {
"count": 3
"count": 2
}
},
"app/components/app/configuration/prompt-value-panel/utils.ts": {
@ -619,11 +619,6 @@
"count": 1
}
},
"app/components/app/switch-app-modal/index.spec.tsx": {
"ts/no-explicit-any": {
"count": 1
}
},
"app/components/app/switch-app-modal/index.tsx": {
"react-hooks-extra/no-direct-set-state-in-use-effect": {
"count": 1
@ -675,7 +670,7 @@
},
"app/components/apps/list.spec.tsx": {
"ts/no-explicit-any": {
"count": 9
"count": 5
}
},
"app/components/apps/list.tsx": {