mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-30 19:35:36 +08:00
fix(editor): Copy to editor not using pinned data from the execution (#28905)
Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
This commit is contained in:
co-authored by
Michael Kret
parent
3637287ee1
commit
20d9215736
+28
@@ -1,6 +1,7 @@
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import { mockedStore } from '@/__tests__/utils';
|
||||
import { useWorkflowsStore } from '@/app/stores/workflows.store';
|
||||
import { useUIStore } from '@/app/stores/ui.store';
|
||||
import {
|
||||
injectWorkflowState,
|
||||
useWorkflowState,
|
||||
@@ -222,4 +223,31 @@ describe('useExecutionDebugging()', () => {
|
||||
expect(setWorkflowExecutionData).toHaveBeenCalledWith(mockExecution);
|
||||
expect(toast.showToast).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('should mark workflow as dirty after pinning imported execution data', async () => {
|
||||
const mockExecution = {
|
||||
data: {
|
||||
resultData: {
|
||||
runData: {
|
||||
TriggerNode: [
|
||||
{
|
||||
data: {
|
||||
main: [[{ json: { id: '1' } }, { json: { id: '2' } }]],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
} as unknown as IExecutionResponse;
|
||||
|
||||
const workflowStore = mockedStore(useWorkflowsStore);
|
||||
const uiStore = mockedStore(useUIStore);
|
||||
mockWorkflowDocumentStore.getNodes.mockReturnValue([{ name: 'TriggerNode' }] as INodeUi[]);
|
||||
workflowStore.getExecution.mockResolvedValueOnce(mockExecution);
|
||||
|
||||
await executionDebugging.applyExecutionData('1');
|
||||
|
||||
expect(uiStore.markStateDirty).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
+4
@@ -130,6 +130,10 @@ export const useExecutionDebugging = (providedWorkflowState?: WorkflowState) =>
|
||||
}
|
||||
});
|
||||
|
||||
if (pinnings > 0 || matchingPinnedNodeNames.length > 0) {
|
||||
uiStore.markStateDirty();
|
||||
}
|
||||
|
||||
toast.showToast({
|
||||
title: i18n.baseText('nodeView.showMessage.debug.title'),
|
||||
message: i18n.baseText('nodeView.showMessage.debug.content'),
|
||||
|
||||
Reference in New Issue
Block a user