mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-24 06:35:10 +00:00
test: add failing test for openJobWorkflow swallowing load errors
This commit is contained in:
@@ -246,6 +246,24 @@ describe('useJobMenu', () => {
|
||||
expect(workflowServiceMock.openWorkflow).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('surfaces an error dialog when workflow open fails', async () => {
|
||||
const { openJobWorkflow } = mountJobMenu()
|
||||
const workflow = { nodes: [{ type: 'rgthree.DisplayAny' }] }
|
||||
getJobWorkflowMock.mockResolvedValue(workflow)
|
||||
const loadError = new Error('configure() failed: malformed widget')
|
||||
workflowServiceMock.openWorkflow.mockRejectedValueOnce(loadError)
|
||||
setCurrentItem(createJobItem({ id: '77' }))
|
||||
|
||||
await expect(openJobWorkflow()).resolves.toBeUndefined()
|
||||
|
||||
expect(dialogServiceMock.showErrorDialog).toHaveBeenCalledWith(
|
||||
loadError,
|
||||
expect.objectContaining({
|
||||
reportType: 'queueOpenWorkflowError'
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
it('copies job id to clipboard', async () => {
|
||||
const { copyJobId } = mountJobMenu()
|
||||
setCurrentItem(createJobItem({ id: 'job-99' }))
|
||||
|
||||
Reference in New Issue
Block a user