fix(editor): Nodes in disabled state appear in the logs (no-changelog) (#15054)

This commit is contained in:
Suguru Inoue
2025-05-02 13:24:23 +02:00
committed by GitHub
parent 20834abb56
commit a4290dcb78
5 changed files with 43 additions and 5 deletions

View File

@@ -224,7 +224,9 @@ describe('useRunWorkflow({ router })', () => {
expect(response).toEqual(mockResponse);
expect(workflowsStore.executionWaitingForWebhook).toBe(true);
});
});
describe('runWorkflow()', () => {
it('should prevent execution and show error message when workflow is active with single webhook trigger', async () => {
const pinia = createTestingPinia({ stubActions: false });
setActivePinia(pinia);
@@ -305,9 +307,7 @@ describe('useRunWorkflow({ router })', () => {
type: 'error',
});
});
});
describe('runWorkflow()', () => {
it('should return undefined if UI action "workflowRunning" is active', async () => {
const { runWorkflow } = useRunWorkflow({ router });
vi.mocked(workflowsStore).setActiveExecutionId('123');
@@ -632,6 +632,25 @@ describe('useRunWorkflow({ router })', () => {
expect(workflowsStore.runWorkflow).toHaveBeenCalledWith(dataCaptor);
expect(dataCaptor.value).toHaveProperty('runData', undefined);
});
it('should set execution data to null if the execution did not start successfully', async () => {
const { runWorkflow } = useRunWorkflow({ router });
const workflow = mock<Workflow>({ name: 'Test Workflow' });
vi.mocked(workflowHelpers).getCurrentWorkflow.mockReturnValue(workflow);
vi.mocked(workflowHelpers).getWorkflowDataToSave.mockResolvedValue({
id: workflow.id,
nodes: [],
} as unknown as IWorkflowData);
// Simulate failed execution start
vi.mocked(workflowsStore).runWorkflow.mockRejectedValueOnce(new Error());
await runWorkflow({});
expect(workflowsStore.runWorkflow).toHaveBeenCalledTimes(1);
expect(workflowsStore.setWorkflowExecutionData).lastCalledWith(null);
});
});
describe('consolidateRunDataAndStartNodes()', () => {