test: add failing test for openJobWorkflow swallowing load errors

This commit is contained in:
dante01yoon
2026-05-08 10:14:36 +09:00
parent 68843967cf
commit a422b392de

View File

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